testutils

package
v0.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 10, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func SameEndpoint

func SameEndpoint(a, b *endpoint.Endpoint) bool

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

func SameEndpointLabels(a, b []*endpoint.Endpoint) bool

SameEndpointLabels verifies that labels of the two slices of endpoints are the same

func SameEndpoints

func SameEndpoints(a, b []*endpoint.Endpoint) bool

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
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

func SamePlanChanges(a, b map[string][]*endpoint.Endpoint) bool

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

type MockSource struct {
	mock.Mock
}

MockSource returns mock endpoints.

func (*MockSource) AddEventHandler added in v0.6.0

func (m *MockSource) AddEventHandler(handler func() error, stopChan <-chan struct{}, minInterval time.Duration)

AddEventHandler adds an event handler function that's called when sources that support such a thing have changed.

func (*MockSource) Endpoints added in v0.4.0

func (m *MockSource) Endpoints() ([]*endpoint.Endpoint, error)

Endpoints returns the desired mock endpoints.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳