eni

package
v1.26.0 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2019 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidateTaskENI

func ValidateTaskENI(acsenis []*ecsacs.ElasticNetworkInterface) error

ValidateTaskENI validates the eni informaiton sent from acs

Types

type ENI

type ENI struct {
	// ID is the id of eni
	ID string `json:"ec2Id"`
	// IPV4Addresses is the ipv4 address associated with the eni
	IPV4Addresses []*ENIIPV4Address
	// IPV6Addresses is the ipv6 address associated with the eni
	IPV6Addresses []*ENIIPV6Address
	// MacAddress is the mac address of the eni
	MacAddress string
	// DomainNameServers specifies the nameserver IP addresses for
	// the eni
	DomainNameServers []string `json:",omitempty"`
	// DomainNameSearchList specifies the search list for the domain
	// name lookup, for the eni
	DomainNameSearchList []string `json:",omitempty"`

	// PrivateDNSName is the dns name assigned by the vpc to this eni
	PrivateDNSName string `json:",omitempty"`
	// SubnetGatewayIPV4Address is the address to the subnet gateway for
	// the eni
	SubnetGatewayIPV4Address string `json:",omitempty"`
}

ENI contains information of the eni

func ENIFromACS

func ENIFromACS(acsenis []*ecsacs.ElasticNetworkInterface) (*ENI, error)

ENIFromACS validates the information from acs message and create the ENI object

func (*ENI) GetHostname

func (eni *ENI) GetHostname() string

GetHostname returns the hostname assigned to the ENI

func (*ENI) GetIPV4Addresses

func (eni *ENI) GetIPV4Addresses() []string

GetIPV4Addresses returns a list of ipv4 addresses allocated to the ENI

func (*ENI) GetIPV6Addresses

func (eni *ENI) GetIPV6Addresses() []string

GetIPV6Addresses returns a list of ipv6 addresses allocated to the ENI

func (*ENI) GetSubnetGatewayIPV4Address added in v1.20.2

func (eni *ENI) GetSubnetGatewayIPV4Address() string

GetSubnetGatewayIPV4Address returns the subnet IPv4 gateway address assigned to the ENI

func (*ENI) String

func (eni *ENI) String() string

String returns a human readable version of the ENI object

type ENIAttachment

type ENIAttachment struct {
	// TaskARN is the task identifier from ecs
	TaskARN string `json:"taskArn"`
	// AttachmentARN is the identifier for the eni attachment
	AttachmentARN string `json:"attachmentArn"`
	// AttachStatusSent indicates whether the attached status has been sent to backend
	AttachStatusSent bool `json:"attachSent"`
	// MACAddress is the mac address of eni
	MACAddress string `json:"macAddress"`
	// Status is the status of the eni: none/attached/detached
	Status ENIAttachmentStatus `json:"status"`
	// ExpiresAt is the timestamp past which the ENI Attachment is considered
	// unsuccessful. The SubmitTaskStateChange API, with the attachment information
	// should be invoked before this timestamp.
	ExpiresAt time.Time `json:"expiresAt"`
	// contains filtered or unexported fields
}

ENIAttachment contains the information of the eni attachment

func (*ENIAttachment) HasExpired

func (eni *ENIAttachment) HasExpired() bool

HasExpired returns true if the ENI attachment object has exceeded the threshold for notifying the backend of the attachment

func (*ENIAttachment) IsSent

func (eni *ENIAttachment) IsSent() bool

IsSent checks if the eni attached status has been sent

func (*ENIAttachment) SetSentStatus

func (eni *ENIAttachment) SetSentStatus()

SetSentStatus marks the eni attached status has been sent

func (*ENIAttachment) StartTimer

func (eni *ENIAttachment) StartTimer(timeoutFunc func()) error

StartTimer starts the ack timer to record the expiration of ENI attachment

func (*ENIAttachment) StopAckTimer

func (eni *ENIAttachment) StopAckTimer()

StopAckTimer stops the ack timer set on the ENI attachment

func (*ENIAttachment) String

func (eni *ENIAttachment) String() string

String returns a string representation of the ENI Attachment

type ENIAttachmentStatus

type ENIAttachmentStatus int32

ENIAttachmentStatus is an enumeration type for eni attachment state

const (
	// ENIAttachmentNone is zero state of a task when received attachemessage from acs
	ENIAttachmentNone ENIAttachmentStatus = iota
	// ENIAttached represents that a eni has shown on the host
	ENIAttached
	// ENIDetached represents that a eni has been actually detached from the host
	ENIDetached
)

func (*ENIAttachmentStatus) ShouldSend

func (eni *ENIAttachmentStatus) ShouldSend() bool

ShouldSend returns whether the status should be sent to backend

func (*ENIAttachmentStatus) String

func (eni *ENIAttachmentStatus) String() string

String return the string value of the eniattachment status

type ENIIPV4Address

type ENIIPV4Address struct {
	// Primary indicates whether the ip address is primary
	Primary bool
	// Address is the ipv4 address associated with eni
	Address string
}

ENIIPV4Address is the ipv4 information of the eni

type ENIIPV6Address

type ENIIPV6Address struct {
	// Address is the ipv6 address associated with eni
	Address string
}

ENIIPV6Address is the ipv6 information of the eni

Jump to

Keyboard shortcuts

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