Documentation
¶
Index ¶
- func LogsToBuffer(level log.Level, t *testing.T) *bytes.Buffer
- func NewTargetsFromAddr(targets []netip.Addr) endpoint.Targets
- func SameEndpoint(a, b *endpoint.Endpoint) bool
- func SameEndpointLabels(a, b []*endpoint.Endpoint) bool
- func SameEndpoints(a, b []*endpoint.Endpoint) bool
- func SamePlanChanges(a, b map[string][]*endpoint.Endpoint) bool
- func SameProviderSpecific(a, b endpoint.ProviderSpecific) bool
- type MockSource
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LogsToBuffer ¶ added in v0.16.0
LogsToBuffer redirects log(s) output to a buffer for testing purposes
Usage: LogsToBuffer(t) Example:
buf := LogsToBuffer(log.DebugLevel, t) ... do something that logs ... assert.Contains(t, buf.String(), "expected debug log message")
func NewTargetsFromAddr ¶ added in v0.16.0
NewTargetsFromAddr convert an array of netip.Addr to Targets (array of string)
func SameEndpoint ¶
SameEndpoint returns true if two endpoints are same considers example.org. and example.org DNSName/Target as different endpoints
func SameEndpointLabels ¶ added in v0.5.18
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]
func SamePlanChanges ¶
SamePlanChanges verifies that two set of changes are the same
func SameProviderSpecific ¶ added in v0.5.18
func SameProviderSpecific(a, b endpoint.ProviderSpecific) bool
SameProviderSpecific verifies that two maps contain the same string/string key/value pairs
Types ¶
type MockSource ¶ added in v0.4.0
MockSource returns mock endpoints.
func (*MockSource) AddEventHandler ¶ added in v0.6.0
func (m *MockSource) AddEventHandler(ctx context.Context, handler func())
AddEventHandler adds an event handler that should be triggered if something in source changes