Add SetIdentifier to EndpointKey

This commit is contained in:
John Gardiner Myers 2023-05-28 10:50:37 -07:00
parent 4417ad4894
commit a9ae5ea43a

View File

@ -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)
}