Documentation
¶
Overview ¶
Package lib provides a clean API for using AWS Multi-ENI Controller functionality as a library in other Go projects. It abstracts away the implementation details and provides a simple interface for managing ENIs.
Index ¶
- type ENIManager
- func (m *ENIManager) AttachENI(ctx context.Context, eniID, instanceID string, deviceIndex int, ...) error
- func (m *ENIManager) CreateENI(ctx context.Context, options ENIOptions) (string, error)
- func (m *ENIManager) DeleteENI(ctx context.Context, eniID string) error
- func (m *ENIManager) DetachENI(ctx context.Context, attachmentID string) error
- func (m *ENIManager) GetENIsByInstance(ctx context.Context, instanceID string) ([]NetworkInterfaceInfo, error)
- func (m *ENIManager) GetSecurityGroupsByVPC(ctx context.Context, vpcID string) ([]SecurityGroupInfo, error)
- func (m *ENIManager) GetSubnetsByVPC(ctx context.Context, vpcID string) ([]SubnetInfo, error)
- type ENIOptions
- type NetworkInterfaceInfo
- type SecurityGroupInfo
- type SubnetInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ENIManager ¶
type ENIManager struct {
// contains filtered or unexported fields
}
ENIManager provides methods for managing AWS Elastic Network Interfaces.
func NewENIManager ¶
NewENIManager creates a new ENIManager with the given configuration.
func NewENIManagerWithConfig ¶
func NewENIManagerWithConfig(ctx context.Context, cfg *config.ControllerConfig, logger logr.Logger) (*ENIManager, error)
NewENIManagerWithConfig creates a new ENIManager with the given configuration.
func (*ENIManager) AttachENI ¶
func (m *ENIManager) AttachENI(ctx context.Context, eniID, instanceID string, deviceIndex int, deleteOnTermination bool) error
AttachENI attaches an ENI to an instance.
func (*ENIManager) CreateENI ¶
func (m *ENIManager) CreateENI(ctx context.Context, options ENIOptions) (string, error)
CreateENI creates a new ENI with the given options and returns its ID.
func (*ENIManager) DeleteENI ¶
func (m *ENIManager) DeleteENI(ctx context.Context, eniID string) error
DeleteENI deletes an ENI.
func (*ENIManager) DetachENI ¶
func (m *ENIManager) DetachENI(ctx context.Context, attachmentID string) error
DetachENI detaches an ENI from an instance.
func (*ENIManager) GetENIsByInstance ¶
func (m *ENIManager) GetENIsByInstance(ctx context.Context, instanceID string) ([]NetworkInterfaceInfo, error)
GetENIsByInstance gets all ENIs attached to an instance.
func (*ENIManager) GetSecurityGroupsByVPC ¶
func (m *ENIManager) GetSecurityGroupsByVPC(ctx context.Context, vpcID string) ([]SecurityGroupInfo, error)
GetSecurityGroupsByVPC gets all security groups in a VPC.
func (*ENIManager) GetSubnetsByVPC ¶
func (m *ENIManager) GetSubnetsByVPC(ctx context.Context, vpcID string) ([]SubnetInfo, error)
GetSubnetsByVPC gets all subnets in a VPC.
type ENIOptions ¶
type ENIOptions struct {
// SubnetID is the ID of the subnet to create the ENI in.
SubnetID string
// SecurityGroupIDs is a list of security group IDs to attach to the ENI.
SecurityGroupIDs []string
// Description is an optional description for the ENI.
Description string
// DeviceIndex is the device index to use when attaching the ENI.
DeviceIndex int
// DeleteOnTermination indicates whether the ENI should be deleted when the instance is terminated.
DeleteOnTermination bool
// Tags is a map of tags to apply to the ENI.
Tags map[string]string
}
ENIOptions contains options for creating a new ENI.
type NetworkInterfaceInfo ¶
type NetworkInterfaceInfo struct {
ID string
SubnetID string
PrivateIP string
DeviceIndex int
Status string
}
NetworkInterfaceInfo represents information about a network interface
type SecurityGroupInfo ¶
SecurityGroupInfo represents information about a security group