agent

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: May 16, 2019 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultPort represents ECS agent introspection API port number
	DefaultPort = 51678
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	GetInstanceMetadata(context.Context) (*ecsTypes.MetadataResponse, error)
	GetTaskMetadataWithDockerID(context.Context, string) (*ecsTypes.TaskResponse, error)
}

Client interface gets metadata

func NewClient

func NewClient(baseURL string) (Client, error)

NewClient creates a new Client

type MockClient

type MockClient struct {
	// contains filtered or unexported fields
}

MockClient represents a mock client of ECS introspection API

func NewMockClient

func NewMockClient(opts ...MockClientOption) *MockClient

NewMockClient creates a new mock client of ECS introspection API

func (*MockClient) ApplyOption

func (c *MockClient) ApplyOption(opt MockClientOption)

ApplyOption applies a mock client option

func (*MockClient) GetInstanceMetadata

func (c *MockClient) GetInstanceMetadata(ctx context.Context) (*ecsTypes.MetadataResponse, error)

GetInstanceMetadata ...

func (*MockClient) GetTaskMetadataWithDockerID

func (c *MockClient) GetTaskMetadataWithDockerID(ctx context.Context, dockerID string) (*ecsTypes.TaskResponse, error)

GetTaskMetadataWithDockerID ...

type MockClientOption

type MockClientOption func(*MockClient)

MockClientOption represents an option of mock client of ECS introspection API

func MockGetInstanceMetadata

func MockGetInstanceMetadata(callback func(context.Context) (*ecsTypes.MetadataResponse, error)) MockClientOption

MockGetInstanceMetadata returns an option to set the callback of GetInstanceMetadata

func MockGetTaskMetadataWithDockerID

func MockGetTaskMetadataWithDockerID(callback func(context.Context, string) (*ecsTypes.TaskResponse, error)) MockClientOption

MockGetTaskMetadataWithDockerID returns an option to set the callback of GetTaskMetadataWithDockerID

Jump to

Keyboard shortcuts

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