Documentation ¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SameEndpoint ¶
SameEndpoint returns true if two endpoints are same considers example.org. and example.org DNSName/Target as different endpoints
func SameEndpointLabels ¶
SameEndpointLabels verifies that labels of the two slices of endpoints are the same
func SameEndpoints ¶
SameEndpoints compares two slices of endpoints regardless of order [x,y,z] == [z,x,y] [x,x,z] == [x,z,x] [x,y,y] != [x,x,y] [x,x,x] != [x,x,z]
Example ¶
eps := []*endpoint.Endpoint{ { DNSName: "example.org", Targets: endpoint.Targets{"load-balancer.org"}, }, { DNSName: "example.org", Targets: endpoint.Targets{"load-balancer.org"}, RecordType: endpoint.RecordTypeTXT, }, { DNSName: "abc.com", Targets: endpoint.Targets{"something"}, RecordType: endpoint.RecordTypeTXT, }, { DNSName: "abc.com", Targets: endpoint.Targets{"1.2.3.4"}, RecordType: endpoint.RecordTypeA, SetIdentifier: "test-set-1", }, { DNSName: "bbc.com", Targets: endpoint.Targets{"foo.com"}, RecordType: endpoint.RecordTypeCNAME, }, { DNSName: "cbc.com", Targets: endpoint.Targets{"foo.com"}, RecordType: "CNAME", RecordTTL: endpoint.TTL(60), }, { DNSName: "example.org", Targets: endpoint.Targets{"load-balancer.org"}, ProviderSpecific: endpoint.ProviderSpecific{ endpoint.ProviderSpecificProperty{Name: "foo", Value: "bar"}, }, }, } sort.Sort(byAllFields(eps)) for _, ep := range eps { fmt.Println(ep) }
Output: abc.com 0 IN A test-set-1 1.2.3.4 [] abc.com 0 IN TXT something [] bbc.com 0 IN CNAME foo.com [] cbc.com 60 IN CNAME foo.com [] example.org 0 IN load-balancer.org [] example.org 0 IN load-balancer.org [{foo bar}] example.org 0 IN TXT load-balancer.org []
func SamePlanChanges ¶
SamePlanChanges verifies that two set of changes are the same
func SameProviderSpecific ¶
func SameProviderSpecific(a, b endpoint.ProviderSpecific) bool
SameProviderSpecific verifies that two maps contain the same string/string key/value pairs
Types ¶
type MockSource ¶
MockSource returns mock endpoints.
func (*MockSource) AddEventHandler ¶
func (m *MockSource) AddEventHandler(ctx context.Context, handler func())
AddEventHandler adds an event handler that should be triggered if something in source changes
Click to show internal directories.
Click to hide internal directories.