func possibleEndpoints(epSpec endpoint, get func(svc string) (*Meta, error)) ([]endpointInfo, error) {
	meta, err := get(epSpec.application)
	if err != nil {
		return nil, err
	}

	var eps []endpointInfo
	add := func(r Relation) {
		if epSpec.relation == "" || epSpec.relation == r.Name {
			eps = append(eps, endpointInfo{
				applicationName: epSpec.application,
				Relation:        r,
			})
		}
	}

	for _, r := range meta.Provides {
		add(r)
	}
	for _, r := range meta.Requires {
		add(r)
	}
	// Every application implicitly provides a juju-info relation.
	add(Relation{
		Name:      "juju-info",
		Role:      RoleProvider,
		Interface: "juju-info",
		Scope:     ScopeGlobal,
	})
	return eps, nil
}
// possibleEndpoints returns all the endpoints that the given endpoint spec
// could refer to.
possibleEndpoints returns all the endpoints that the given endpoint spec
could refer to.
// possibleEndpoints returns all the endpoints that the given endpoint spec // could refer to .
func possibleEndpoints(epSpec endpoint, get func(svc string) (*Meta, error)) ([]endpointInfo, error) {
	meta, err := get(epSpec.application)
	if err != nil {
		return nil, err
	}
	var eps []endpointInfo
	add := func(r Relation) {
		if epSpec.relation == "" || epSpec.relation == r.Name {
			eps = append(eps, endpointInfo{
				applicationName: epSpec.application,
				Relation:        r,
			})
		}
	}
	for _, r := range meta.Provides {
		add(r)
	}
	for _, r := range meta.Requires {
		add(r)
	}
	add(Relation{
		Name:      "juju-info",
		Role:      RoleProvider,
		Interface: "juju-info",
		Scope:     ScopeGlobal,
	})
	return eps, nil
}
func possibleEndpoints ( epSpec endpoint , get func ( svc string ) ( * Meta , error ) ) ( [ ] endpointInfo , error ) { meta , err := get ( epSpec . application ) if err != nil { return nil , err } var eps [ ] endpointInfo add := func ( r Relation ) { if epSpec . relation == " " || epSpec . relation == r . Name { eps = append ( eps , endpointInfo { applicationName : epSpec . application , Relation : r , } ) } } for _ , r := range meta . Provides { add ( r ) } for _ , r := range meta . Requires { add ( r ) } add ( Relation { Name : " " , Role : RoleProvider , Interface : " " , Scope : ScopeGlobal , } ) return eps , nil }
possibleEndpoints returns all the endpoints that the given endpoint spec
could refer to.
possibleEndpoints returns all the endpoints that the given endpoint spec could refer to .
// Every application implicitly provides a juju-info relation.