Documentation ¶
Overview ¶
Package clecsmeta provides metadata information about the ECS instance the code is running on.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNoMetadataURI = errors.New("no metadata uri provided")
ErrNoMetadataURI if the code provided no metadata uri.
Functions ¶
func TestProvide ¶
TestProvide provides the metadata for testing environment.
Types ¶
type ContainerMetadataV4 ¶
type ContainerMetadataV4 struct { DockerID string `json:"DockerId"` Name string `json:"Name"` DockerName string `json:"DockerName"` Image string `json:"Image"` ImageID string `json:"ImageID"` Labels LabelsV4 `json:"Labels"` DesiredStatus string `json:"DesiredStatus"` KnownStatus string `json:"KnownStatus"` Limits Limits `json:"Limits"` CreatedAt time.Time `json:"CreatedAt"` StartedAt time.Time `json:"StartedAt"` Type string `json:"Type"` ContainerARN string `json:"ContainerARN"` LogDriver string `json:"LogDriver"` LogOptions struct { AwsLogsCreateGroup string `json:"awslogs-create-group"` AwsLogsGroup string `json:"awslogs-group"` AwsLogsStream string `json:"awslogs-stream"` AwsRegion string `json:"awslogs-region"` } `json:"LogOptions"` Networks []struct { NetworkMode string `json:"NetworkMode"` IPv4Addresses []string `json:"IPv4Addresses"` AttachmentIndex int `json:"AttachmentIndex"` IPv4SubnetCIDRBlock string `json:"IPv4SubnetCIDRBlock"` MACAddress string `json:"MACAddress"` DomainNameServers []string `json:"DomainNameServers"` DomainNameSearchList []string `json:"DomainNameSearchList"` PrivateDNSName string `json:"PrivateDNSName"` SubnetGatewayIpv4Address string `json:"SubnetGatewayIpv4Address"` } `json:"Networks"` }
type LabelsV4 ¶
type LabelsV4 struct { EcsCluster string `json:"-"` EcsContainerName string `json:"-"` EcsTaskArn string `json:"-"` EcsTaskDefinitionFamily string `json:"-"` EcsTaskDefinitionVersion string `json:"-"` // contains filtered or unexported fields }
func (*LabelsV4) UnmarshalJSON ¶
type Metadata ¶
type Metadata struct {
// contains filtered or unexported fields
}
Metadata instance.
func New ¶
func New(cfg Config, logs *zap.Logger, client *http.Client, ecsMetadataURI string) (*Metadata, error)
New inits the empty metadata.
func (Metadata) TaskV4 ¶
func (md Metadata) TaskV4() TaskMetadataV4
type TaskMetadataV4 ¶
type TaskMetadataV4 struct { Cluster string `json:"Cluster"` TaskARN string `json:"TaskARN"` Family string `json:"Family"` Revision string `json:"Revision"` DesiredStatus string `json:"DesiredStatus"` KnownStatus string `json:"KnownStatus"` Limits Limits `json:"Limits"` PullStartedAt time.Time `json:"PullStartedAt"` PullStoppedAt time.Time `json:"PullStoppedAt"` AvailabilityZone string `json:"AvailabilityZone"` LaunchType string `json:"LaunchType"` Containers []ContainerMetadataV4 `json:"Containers"` }
Click to show internal directories.
Click to hide internal directories.