mock

package
v1.6.11 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2020 License: Apache-2.0 Imports: 9 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 []*types.Subnet, vpcs []*types.Vpc) *API

func (*API) AssignPrivateIpAddresses

func (e *API) AssignPrivateIpAddresses(eniID string, addresses int64) error

func (*API) AttachNetworkInterface

func (e *API) AttachNetworkInterface(index int64, instanceID, eniID string) (string, error)

func (*API) CreateNetworkInterface

func (e *API) CreateNetworkInterface(toAllocate int64, subnetID, desc string, groups []string) (string, *v2.ENI, error)

func (*API) DeleteNetworkInterface

func (e *API) DeleteNetworkInterface(eniID string) error

func (*API) GetInstances

func (e *API) GetInstances(vpcs types.VpcMap, subnets types.SubnetMap) (types.InstanceMap, error)

func (*API) GetSubnets

func (e *API) GetSubnets() (types.SubnetMap, error)

func (*API) GetVpcs

func (e *API) GetVpcs() (types.VpcMap, error)

func (*API) ModifyNetworkInterface

func (e *API) ModifyNetworkInterface(eniID, attachmentID string, deleteOnTermination bool) error

func (*API) SetDelay

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

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

func (*API) SetLimiter

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

SetLimiter adds a rate limiter to all simulated API calls

func (*API) SetMockError

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

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

func (*API) UnassignPrivateIpAddresses

func (e *API) UnassignPrivateIpAddresses(eniID string, addresses []string) error

type Operation

type Operation int

Operation is an EC2 API operation that this mock API supports

const (
	AllOperations Operation = iota
	CreateNetworkInterface
	DeleteNetworkInterface
	AttachNetworkInterface
	ModifyNetworkInterface
	AssignPrivateIpAddresses
	UnassignPrivateIpAddresses
	TagENI
	MaxOperation
)

Jump to

Keyboard shortcuts

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