helpers

package
v1.15.1 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SVCIPv4 = SVCL3Type("IPv4")
	SVCIPv6 = SVCL3Type("IPV6")
)

Variables

This section is empty.

Functions

func MapInOrder

func MapInOrder[M ~map[K]V, K constraints.Ordered, V any](m M, fn func(K, V))

MapInOrder does an in-order traversal of a map.

func ValidateLBMapGoldenFile

func ValidateLBMapGoldenFile(file string, datapath *fakeDatapath.FakeDatapath) error

Types

type LBMapAssert

type LBMapAssert struct {
	// contains filtered or unexported fields
}

func NewLBMapAssert

func NewLBMapAssert(lbmap *mockmaps.LBMockMap) LBMapAssert

func (LBMapAssert) FindServiceWithBackend

func (a LBMapAssert) FindServiceWithBackend(name string, svcType lb.SVCType, l3 SVCL3Type, l4 lb.L4Type, port uint16) *lb.SVC

findService finds a service matching the parameters and that it has a backend with specified l4 type and port.

Linear in time, but should be OK for tests with few 10s of services and backends.

func (LBMapAssert) ServicesExist

func (a LBMapAssert) ServicesExist(name string, svcTypes []lb.SVCType, l3s []SVCL3Type, l4 lb.L4Type, port uint16) error

servicesExist asserts that the service with given name (<namespace>/<name>) exists for the listed service types and has frontends with the given L3 protocols, and that it has backend with the given L4 type and port.

type SVCL3Type

type SVCL3Type string

Jump to

Keyboard shortcuts

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