mock

package
v1.13.6 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

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

func NewAPI

func NewAPI(subnets []*ipamTypes.Subnet, vnets []*ipamTypes.VirtualNetwork) *API

func (*API) AssignPrivateIpAddressesVM

func (a *API) AssignPrivateIpAddressesVM(ctx context.Context, subnetID, interfaceName string, addresses int) error

func (*API) AssignPrivateIpAddressesVMSS

func (a *API) AssignPrivateIpAddressesVMSS(ctx context.Context, vmName, vmssName, subnetID, interfaceName string, addresses int) error

func (*API) GetInstances

func (a *API) GetInstances(ctx context.Context, subnets ipamTypes.SubnetMap) (*ipamTypes.InstanceMap, error)

func (*API) GetVpcsAndSubnets

func (a *API) GetVpcsAndSubnets(ctx context.Context) (ipamTypes.VirtualNetworkMap, ipamTypes.SubnetMap, error)

func (*API) SetDelay

func (a *API) SetDelay(op Operation, delay time.Duration)

SetDelay specifies the delay which should be simulated for an individual Azure API operation

func (*API) SetLimiter

func (a *API) SetLimiter(limit float64, burst int)

SetLimiter adds a rate limiter to all simulated API calls

func (*API) SetMockError

func (a *API) SetMockError(op Operation, err error)

SetMockError modifies the mock API to return an error for a particular operation

func (*API) UpdateInstances

func (a *API) UpdateInstances(instances *ipamTypes.InstanceMap)

func (*API) UpdateSubnets

func (a *API) UpdateSubnets(subnets []*ipamTypes.Subnet)

type Operation

type Operation int

Operation is an Azure API operation that this mock API supports

const (
	AllOperations Operation = iota
	GetInstances
	GetVpcsAndSubnets
	AssignPrivateIpAddressesVMSS
	MaxOperation
)

Jump to

Keyboard shortcuts

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