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
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
Click to show internal directories.
Click to hide internal directories.