diff --git a/endpoint/endpoint.go b/endpoint/endpoint.go index c49f2b7b0..7df3f882f 100644 --- a/endpoint/endpoint.go +++ b/endpoint/endpoint.go @@ -164,8 +164,9 @@ type ProviderSpecific []ProviderSpecificProperty // EndpointKey is the type of a map key for separating endpoints or targets. type EndpointKey struct { - DNSName string - RecordType string + DNSName string + RecordType string + SetIdentifier string } // Endpoint is a high-level way of a connection between a service and an IP @@ -267,6 +268,15 @@ func (e *Endpoint) DeleteProviderSpecificProperty(key string) { } } +// Key returns the EndpointKey of the Endpoint. +func (e *Endpoint) Key() EndpointKey { + return EndpointKey{ + DNSName: e.DNSName, + RecordType: e.RecordType, + SetIdentifier: e.SetIdentifier, + } +} + func (e *Endpoint) String() string { return fmt.Sprintf("%s %d IN %s %s %s %s", e.DNSName, e.RecordTTL, e.RecordType, e.SetIdentifier, e.Targets, e.ProviderSpecific) }