Documentation ¶
Index ¶
Constants ¶
View Source
const (
// DefaultURL represents Task Metadata URL
DefaultURL = "http://169.254.170.2"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface { GetMetadata(context.Context) (*ecsTypes.TaskResponse, error) GetStats(context.Context) (map[string]*dockerTypes.Stats, error) }
Client interface gets metadata and stats
type MockClient ¶
type MockClient struct {
// contains filtered or unexported fields
}
MockClient a mock client of ECS task metadata endpoint
func NewMockClient ¶
func NewMockClient(opts ...MockClientOption) *MockClient
NewMockClient creates a new mock client of ECS task metadata endpoint
func (*MockClient) ApplyOption ¶
func (c *MockClient) ApplyOption(opt MockClientOption)
ApplyOption applies a mock client option
func (*MockClient) GetMetadata ¶
func (c *MockClient) GetMetadata(ctx context.Context) (*ecsTypes.TaskResponse, error)
GetMetadata ...
func (*MockClient) GetStats ¶
func (c *MockClient) GetStats(ctx context.Context) (map[string]*dockerTypes.Stats, error)
GetStats ...
type MockClientOption ¶
type MockClientOption func(*MockClient)
MockClientOption represents an option of mock client of ECS task metadata endpoint
func MockGetMetadata ¶
func MockGetMetadata(callback func(context.Context) (*ecsTypes.TaskResponse, error)) MockClientOption
MockGetMetadata returns an option to set the callback of GetMetadata
func MockGetStats ¶
func MockGetStats(callback func(context.Context) (map[string]*dockerTypes.Stats, error)) MockClientOption
MockGetStats returns an option to set the callback of GetStats
Click to show internal directories.
Click to hide internal directories.