Documentation ¶
Index ¶
- type API
- func (e *API) AssignPrivateIpAddresses(ctx context.Context, eniID string, addresses int32) error
- func (e *API) AttachNetworkInterface(ctx context.Context, index int32, instanceID, eniID string) (string, error)
- func (e *API) CreateNetworkInterface(ctx context.Context, toAllocate int32, subnetID, desc string, groups []string) (string, *eniTypes.ENI, error)
- func (e *API) DeleteNetworkInterface(ctx context.Context, eniID string) error
- func (e *API) GetInstances(ctx context.Context, vpcs ipamTypes.VirtualNetworkMap, ...) (*ipamTypes.InstanceMap, error)
- func (e *API) GetSecurityGroups(ctx context.Context) (types.SecurityGroupMap, error)
- func (e *API) GetSubnets(ctx context.Context) (ipamTypes.SubnetMap, error)
- func (e *API) GetVpcs(ctx context.Context) (ipamTypes.VirtualNetworkMap, error)
- func (e *API) ModifyNetworkInterface(ctx context.Context, eniID, attachmentID string, deleteOnTermination bool) error
- func (e *API) SetDelay(op Operation, delay time.Duration)
- func (e *API) SetLimiter(limit float64, burst int)
- func (e *API) SetMockError(op Operation, err error)
- func (e *API) TagENI(ctx context.Context, eniID string, eniTags map[string]string) error
- func (e *API) UnassignPrivateIpAddresses(ctx context.Context, eniID string, addresses []string) error
- func (e *API) UpdateENIs(enis map[string]ENIMap)
- func (e *API) UpdateSecurityGroups(securityGroups []*types.SecurityGroup)
- func (e *API) UpdateSubnets(subnets []*ipamTypes.Subnet)
- type ENIMap
- type Operation
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
}
API represents a mocked EC2 API
func NewAPI ¶
func NewAPI(subnets []*ipamTypes.Subnet, vpcs []*ipamTypes.VirtualNetwork, securityGroups []*types.SecurityGroup) *API
NewAPI returns a new mocked EC2 API
func (*API) AssignPrivateIpAddresses ¶
func (*API) AttachNetworkInterface ¶
func (*API) CreateNetworkInterface ¶
func (e *API) CreateNetworkInterface(ctx context.Context, toAllocate int32, subnetID, desc string, groups []string) (string, *eniTypes.ENI, error)
CreateNetworkInterface mocks the interface creation. As with the upstream EC2 API, the number of IP addresses in toAllocate are the number of secondary IPs, a primary IP is always allocated.
func (*API) DeleteNetworkInterface ¶
func (*API) GetInstances ¶
func (e *API) GetInstances(ctx context.Context, vpcs ipamTypes.VirtualNetworkMap, subnets ipamTypes.SubnetMap) (*ipamTypes.InstanceMap, error)
func (*API) GetSecurityGroups ¶
func (*API) ModifyNetworkInterface ¶
func (*API) SetDelay ¶
SetDelay specifies the delay which should be simulated for an individual EC2 API operation
func (*API) SetLimiter ¶
SetLimiter adds a rate limiter to all simulated API calls
func (*API) SetMockError ¶
SetMockError modifies the mock API to return an error for a particular operation
func (*API) UnassignPrivateIpAddresses ¶
func (*API) UpdateENIs ¶
UpdateENIs replaces the ENIs which the mock API will return
func (*API) UpdateSecurityGroups ¶
func (e *API) UpdateSecurityGroups(securityGroups []*types.SecurityGroup)
UpdateSecurityGroups replaces the security groups which the mock API will return
func (*API) UpdateSubnets ¶
UpdateSubnets replaces the subents which the mock API will return