func parseScope()

in adapter/pkg/provider/provider.go [302:320]


func parseScope(entity *swctlapi.Entity) swctlapi.Scope {
	scope := swctlapi.ScopeAll

	if *entity.DestEndpointName != "" {
		scope = swctlapi.ScopeEndpointRelation
	} else if *entity.DestServiceInstanceName != "" {
		scope = swctlapi.ScopeServiceInstanceRelation
	} else if *entity.DestServiceName != "" {
		scope = swctlapi.ScopeServiceRelation
	} else if *entity.EndpointName != "" {
		scope = swctlapi.ScopeEndpoint
	} else if *entity.ServiceInstanceName != "" {
		scope = swctlapi.ScopeServiceInstance
	} else if *entity.ServiceName != "" {
		scope = swctlapi.ScopeService
	}

	return scope
}