common

package
v0.0.0-...-8cc68c2 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2023 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var TestCases []*TestCase = []*TestCase{
	&TestCase{
		IncludeList:          []string{"foo.bar", "foo.baz"},
		AdjustEndpointsInput: append(TestData["foo.bar"].Endpoints, TestData["foo.baz"].Endpoints...),
		ApplyChangesInput: &plan.Changes{
			Create: []*endpoint.Endpoint{
				endpoint.NewEndpoint("aaa.foo.bar", "A", "10.1.1.1"),
			},
			Delete: []*endpoint.Endpoint{
				endpoint.NewEndpoint("aaa.foo.bar", "A", "10.1.1.1"),
			},
			UpdateOld: []*endpoint.Endpoint{
				endpoint.NewEndpointWithTTL("update.foo.baz", "A", 500, "1.1.1.1", "2.2.2.2"),
			},
			UpdateNew: []*endpoint.Endpoint{
				endpoint.NewEndpointWithTTL("update.foo.baz", "A", 1500, "3.3.3.3", "5.5.5.5"),
			},
		},
	},
	&TestCase{
		IncludeList:          []string{"foo.zzz"},
		AdjustEndpointsInput: TestData["foo.zzz"].Endpoints,
		ApplyChangesInput: &plan.Changes{
			Create: []*endpoint.Endpoint{
				endpoint.NewEndpoint("aaa.foo.zzz", "A", "10.1.1.1"),
			},
			Delete: []*endpoint.Endpoint{
				endpoint.NewEndpoint("bbb.foo.zzz", "A", "10.1.1.1"),
			},
			UpdateOld: []*endpoint.Endpoint{
				endpoint.NewEndpointWithTTL("single.foo.zzz", "A", 500, "172.16.100.199", "172.16.100.200"),
			},
			UpdateNew: []*endpoint.Endpoint{
				endpoint.NewEndpointWithTTL("single.foo.zzz", "A", 1500, "172.16.100.199", "172.16.100.200"),
			},
		},
	},
}
View Source
var TestData map[string]*ZoneInfo = map[string]*ZoneInfo{
	"foo.bar": &ZoneInfo{
		ZoneData: &ZoneData{},
		Endpoints: []*endpoint.Endpoint{
			endpoint.NewEndpoint("a.foo.bar", "A", "1.1.1.1"),
			endpoint.NewEndpoint("b.foo.bar", "A", "1.1.1.3"),
			endpoint.NewEndpoint("z.foo.bar", "A", "1.1.1.4"),
			endpoint.NewEndpoint("z.foo.bar", "TXT", "foobar"),
		}},
	"foo.baz": &ZoneInfo{
		ZoneData: &ZoneData{},
		Endpoints: []*endpoint.Endpoint{
			endpoint.NewEndpoint("n1.foo.baz", "A", "192.168.1.1"),
			endpoint.NewEndpoint("hello.foo.baz", "A", "192.168.1.3"),
			endpoint.NewEndpoint("foo.baz", "A", "192.168.1.4"),
		}},
	"foo.zzz": &ZoneInfo{
		ZoneData: &ZoneData{},
		Endpoints: []*endpoint.Endpoint{
			endpoint.NewEndpoint("single.foo.zzz", "A", "172.16.100.199"),
			endpoint.NewEndpoint("single.foo.zzz", "A", "172.16.100.200"),
			endpoint.NewEndpoint("bbb.foo.zzz", "A", "172.17.100.199"),
		},
	},
}

Functions

func CreateDomainFilter

func CreateDomainFilter(regexDomainFilter string, regexDomainExclude string, listDomainFilter []string, listDomainFilterExclude []string) *endpoint.DomainFilter

utilities

func ExpandRecords

func ExpandRecords(eps []*endpoint.Endpoint) []*endpoint.Endpoint

func SameEndpoints

func SameEndpoints(eps1 []*endpoint.Endpoint, eps2 []*endpoint.Endpoint) bool

compare two lists of endpoints

Types

type TestCase

type TestCase struct {
	IncludeList          []string
	ExcludeList          []string
	IncludeRegex         string
	ExcludeRegex         string
	AdjustEndpointsInput []*endpoint.Endpoint
	ApplyChangesInput    *plan.Changes
}

type ZoneData

type ZoneData struct {
	TargetLink      string
	HostedDnsZoneId string
}

func (*ZoneData) String

func (z *ZoneData) String() string

type ZoneInfo

type ZoneInfo struct {
	Endpoints []*endpoint.Endpoint
	ZoneData  *ZoneData
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL