func (p *AWSSDProvider) Records() (endpoints []*endpoint.Endpoint, err error) {
	namespaces, err := p.ListNamespaces()
	if err != nil {
		return nil, err
	}

	for _, ns := range namespaces {
		services, err := p.ListServicesByNamespaceID(ns.Id)
		if err != nil {
			return nil, err
		}

		for _, srv := range services {
			instances, err := p.ListInstancesByServiceID(srv.Id)
			if err != nil {
				return nil, err
			}

			if len(instances) > 0 {
				ep := p.instancesToEndpoint(ns, srv, instances)
				endpoints = append(endpoints, ep)
			}
		}
	}

	return endpoints, nil
}
func (p *AWSSDProvider) Records() (endpoints []*endpoint.Endpoint, err error) {
	namespaces, err := p.ListNamespaces()
	if err != nil {
		return nil, err
	}

	for _, ns := range namespaces {
		services, err := p.ListServicesByNamespaceID(ns.Id)
		if err != nil {
			return nil, err
		}

		for _, srv := range services {
			instances, err := p.ListInstancesByServiceID(srv.Id)
			if err != nil {
				return nil, err
			}

			if len(instances) > 0 {
				ep := p.instancesToEndpoint(ns, srv, instances)
				endpoints = append(endpoints, ep)
			}
		}
	}

	return endpoints, nil
}
func ( p * AWSSDProvider ) Records ( ) ( endpoints [ ] * endpoint . Endpoint , err error ) { namespaces , err := p . ListNamespaces ( ) if err != nil { return nil , err } for _ , ns := range namespaces { services , err := p . ListServicesByNamespaceID ( ns . Id ) if err != nil { return nil , err } for _ , srv := range services { instances , err := p . ListInstancesByServiceID ( srv . Id ) if err != nil { return nil , err } if len ( instances ) > 0 { ep := p . instancesToEndpoint ( ns , srv , instances ) endpoints = append ( endpoints , ep ) } } } return endpoints , nil }
// Records returns list of all endpoints.
Records returns list of all endpoints .