From a9ae5ea43a46cb25de64a4016cf5e95df8918a43 Mon Sep 17 00:00:00 2001 From: John Gardiner Myers Date: Sun, 28 May 2023 10:50:37 -0700 Subject: [PATCH] Add SetIdentifier to EndpointKey --- endpoint/endpoint.go | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) 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) }