mockmaps

package
v1.9.6 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CtMockMap

type CtMockMap struct {
	Entries []ctmap.CtMapRecord
}

CtMockMap implements the CtMap interface and can be used for unit tests.

func NewCtMockMap

func NewCtMockMap(records []ctmap.CtMapRecord) *CtMockMap

NewCtMockMap is a constructor for a CtMockMap.

func (*CtMockMap) Close

func (m *CtMockMap) Close() error

Close does nothing, mock maps need not be closed either.

func (*CtMockMap) DumpEntries

func (m *CtMockMap) DumpEntries() (string, error)

DumpEntries iterates through Map m and writes the values of the ct entries in m to a string.

func (*CtMockMap) DumpWithCallback

func (m *CtMockMap) DumpWithCallback(cb bpf.DumpCallback) error

DumpWithCallback runs the callback on each entry of the mock map.

func (*CtMockMap) Open

func (m *CtMockMap) Open() error

Open does nothing, mock maps need not be opened.

func (*CtMockMap) Path

func (m *CtMockMap) Path() (string, error)

Path returns a mock path for the mock map.

type LBMockMap

type LBMockMap struct {
	BackendByID   map[uint16]*lb.Backend
	ServiceByID   map[uint16]*lb.SVC
	AffinityMatch lbmap.BackendIDByServiceIDSet
	SourceRanges  lbmap.SourceRangeSetByServiceID
}

func NewLBMockMap

func NewLBMockMap() *LBMockMap

func (*LBMockMap) AddAffinityMatch

func (m *LBMockMap) AddAffinityMatch(revNATID uint16, backendID uint16) error

func (*LBMockMap) AddBackend

func (m *LBMockMap) AddBackend(id uint16, ip net.IP, port uint16, ipv6 bool) error

func (*LBMockMap) DeleteAffinityMatch

func (m *LBMockMap) DeleteAffinityMatch(revNATID uint16, backendID uint16) error

func (*LBMockMap) DeleteBackendByID

func (m *LBMockMap) DeleteBackendByID(id uint16, ipv6 bool) error

func (*LBMockMap) DeleteService

func (m *LBMockMap) DeleteService(addr lb.L3n4AddrID, backendCount int, maglev bool) error

func (*LBMockMap) DumpAffinityMatches

func (m *LBMockMap) DumpAffinityMatches() (lbmap.BackendIDByServiceIDSet, error)

func (*LBMockMap) DumpBackendMaps

func (m *LBMockMap) DumpBackendMaps() ([]*lb.Backend, error)

func (*LBMockMap) DumpServiceMaps

func (m *LBMockMap) DumpServiceMaps() ([]*lb.SVC, []error)

func (*LBMockMap) DumpSourceRanges

func (m *LBMockMap) DumpSourceRanges(ipv6 bool) (lbmap.SourceRangeSetByServiceID, error)

func (*LBMockMap) UpdateSourceRanges

func (m *LBMockMap) UpdateSourceRanges(revNATID uint16, prevRanges []*cidr.CIDR,
	ranges []*cidr.CIDR, ipv6 bool) error

func (*LBMockMap) UpsertService

func (m *LBMockMap) UpsertService(p *lbmap.UpsertServiceParams) error

type NatMockMap

type NatMockMap struct {
	Entries []nat.NatMapRecord
}

NatMockMap implements the NatMap interface and can be used for unit tests.

func NewNatMockMap

func NewNatMockMap(records []nat.NatMapRecord) *NatMockMap

NewNatMockMap is a constructor for a NatMockMap.

func (*NatMockMap) Close

func (m *NatMockMap) Close() error

Close does nothing, mock maps need not be closed either.

func (*NatMockMap) DumpEntries

func (m *NatMockMap) DumpEntries() (string, error)

DumpEntries iterates through Map m and writes the values of the ct entries in m to a string.

func (*NatMockMap) DumpWithCallback

func (m *NatMockMap) DumpWithCallback(cb bpf.DumpCallback) error

DumpWithCallback runs the callback on each entry of the mock map.

func (*NatMockMap) Open

func (m *NatMockMap) Open() error

Open does nothing, mock maps need not be opened.

func (*NatMockMap) Path

func (m *NatMockMap) Path() (string, error)

Path returns a mock path for the mock map.

Jump to

Keyboard shortcuts

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