ecsclient

package
v0.0.0-...-b702281 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: Apache-2.0 Imports: 30 Imported by: 2

Documentation

Index

Constants

View Source
const (

	// RoundtripTimeout should only time out after dial and TLS handshake timeouts have elapsed.
	// Add additional 2 seconds to the sum of these 2 timeouts to be extra sure of this.
	RoundtripTimeout = httpclient.DefaultDialTimeout + httpclient.DefaultTLSHandshakeTimeout + 2*time.Second
)

Variables

This section is empty.

Functions

func NewECSClient

func NewECSClient(
	credentialsProvider *credentials.Credentials,
	configAccessor config.AgentConfigAccessor,
	ec2MetadataClient ec2.EC2MetadataClient,
	agentVer string,
	options ...ECSClientOption) (ecs.ECSClient, error)

NewECSClient creates a new ECSClient interface object.

Types

type ECSClientFactory

type ECSClientFactory interface {
	// NewClient creates a new ECS client.
	NewClient() (ecs.ECSClient, error)
	// GetCredentials returns the credentials chain used by the ECS client.
	GetCredentials() *credentials.Credentials
}

ECSClientFactory interface can be used to create new ECS clients. It wraps the internal ecsClientFactory and can help ease writing unit test code for consumers.

func NewECSClientFactory

func NewECSClientFactory(
	credentialsProvider *credentials.Credentials,
	configAccessor config.AgentConfigAccessor,
	ec2MetadataClient ec2.EC2MetadataClient,
	agentVersion string,
	options ...ECSClientOption) ECSClientFactory

type ECSClientOption

type ECSClientOption func(*ecsClient)

ECSClientOption allows for configuration of an ecsClient.

func WithDiscoverPollEndpointCache

func WithDiscoverPollEndpointCache(c async.TTLCache) ECSClientOption

WithDiscoverPollEndpointCache is an ECSClientOption that configures the ecsClient.pollEndpointCache with the value passed as a parameter. This is especially useful for injecting a test implementation.

func WithDiscoverPollEndpointCacheTTL

func WithDiscoverPollEndpointCacheTTL(t *async.TTL) ECSClientOption

WithDiscoverPollEndpointCacheTTL is an ECSClientOption that configures the ecsClient.pollEndpointCache.ttl with the value passed as a parameter.

func WithFIPSDetected

func WithFIPSDetected(val bool) ECSClientOption

WithFIPSDetected is an ECSClientOption that configures the ecsClient.isFIPSDetected with the value passed as a parameter.

func WithIPv6PortBindingExcluded

func WithIPv6PortBindingExcluded(val bool) ECSClientOption

WithIPv6PortBindingExcluded is an ECSClientOption that configures the ecsClient.shouldExcludeIPv6PortBinding with the value passed as a parameter.

func WithSASCCustomRetryBackoff

func WithSASCCustomRetryBackoff(f func(func() error) error) ECSClientOption

WithSASCCustomRetryBackoff is an ECSClientOption that configures the ecsClient.sascCustomRetryBackoff with the value passed as a parameter.

func WithSTSCAttachmentCustomRetryBackoff

func WithSTSCAttachmentCustomRetryBackoff(f func(func() error) error) ECSClientOption

WithSTSCAttachmentCustomRetryBackoff is an ECSClientOption that configures the ecsClient.stscAttachmentCustomRetryBackoff with the value passed as a parameter.

func WithStandardClient

func WithStandardClient(s ecs.ECSStandardSDK) ECSClientOption

WithStandardClient is an ECSClientOption that configures the ecsClient.standardClient with the value passed as a parameter. This is especially useful for injecting a test implementation.

func WithSubmitStateChangeClient

func WithSubmitStateChangeClient(s ecs.ECSSubmitStateSDK) ECSClientOption

WithSubmitStateChangeClient is an ECSClientOption that configures the ecsClient.submitStateChangeClient with the value passed as a parameter. This is especially useful for injecting a test implementation.

Jump to

Keyboard shortcuts

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