mocks

package
v3.29.0 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2024 License: Apache-2.0, Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IpamCacheStub

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

IpamCacheStub is stub implementation of watchers.IpamCache.

func NewIpamCacheStub

func NewIpamCacheStub() *IpamCacheStub

NewIpamCacheStub creates new IpamCacheStub instance

func (*IpamCacheStub) AddPrefixIPPool

func (s *IpamCacheStub) AddPrefixIPPool(prefix *net.IPNet, ipPool *proto.IPAMPoolUpdate)

func (*IpamCacheStub) GetPrefixIPPool

func (s *IpamCacheStub) GetPrefixIPPool(prefix *net.IPNet) *proto.IPAMPool

GetPrefixIPPool returns cached IPPools for given prefixes for testing purposes. If no such IPPool exists, it is created. This function never runs out of IPPools

func (*IpamCacheStub) IPNetNeedsSNAT

func (s *IpamCacheStub) IPNetNeedsSNAT(prefix *net.IPNet) bool

func (*IpamCacheStub) SyncIPAM

func (s *IpamCacheStub) SyncIPAM(t *tomb.Tomb) error

func (*IpamCacheStub) WaitReady

func (s *IpamCacheStub) WaitReady()

type PubSubHandlerMock

type PubSubHandlerMock struct {
	ReceivedEvents []common.CalicoVppEvent
	// contains filtered or unexported fields
}

PubSubHandlerMock is mocking the handlers registering to common.ThePubSub

func NewPubSubHandlerMock

func NewPubSubHandlerMock(expectedEventTypes ...common.CalicoVppEventType) *PubSubHandlerMock

NewPubSubHandlerMock creates new instance of PubSubHandlerMock

func (*PubSubHandlerMock) Start

func (m *PubSubHandlerMock) Start()

Start register this handler to common.ThePubSub and starts its handling loop in another go routing

func (*PubSubHandlerMock) Stop

func (m *PubSubHandlerMock) Stop() error

Stop does graceful shutdown of this handler

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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