interfaces

package
v0.0.0-...-f9b3b8e Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2017 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrServiceNotFound        = errors.New("service not found")
	ErrTaskDefinitionNotFound = errors.New("task definition not found")
)

Errors.

Functions

This section is empty.

Types

type AwsEcsAPI

type AwsEcsAPI interface {
	// ListServices returns the service arns of the current cluster.
	ListServices() ([]string, error)

	// DescribeService returns the service description for a single service.
	// Returns ErrServiceNotFound if the service is not found.
	DescribeService(serviceArn string) (*ecs.Service, error)

	// DescribeTaskDefinition returns the task definition for the provided arn.
	// Returns ErrTaskDefinitionNotFound if the task definition is not found.
	DescribeTaskDefinition(taskDefArn string) (*ecs.TaskDefinition, error)
}

AwsEcsAPI abstracts the use of the AWS ECS API.

type AwsEcsAPIMock

type AwsEcsAPIMock struct {
	// Flags that determine whether an error will always be returned.
	FailListServices           bool
	FailDescribeService        bool
	FailDescribeTaskDefinition bool

	// Return values.
	ServiceNames []string
	Services     map[string]*ecs.Service
	TaskDefs     map[string]*ecs.TaskDefinition
}

AwsEcsAPIMock mocks the AWS ECS API by providing flags that determine whether method calls always fail, and exposing the various return values in public members of the struct.

func NewAwsEcsAPIMock

func NewAwsEcsAPIMock() *AwsEcsAPIMock

NewAwsEcsAPIMock creates a new AWS ECS API mock with initialized map members.

func (*AwsEcsAPIMock) DescribeService

func (m *AwsEcsAPIMock) DescribeService(serviceArn string) (*ecs.Service, error)

DescribeService returns the service description for a single service.

func (*AwsEcsAPIMock) DescribeTaskDefinition

func (m *AwsEcsAPIMock) DescribeTaskDefinition(taskDefArn string) (*ecs.TaskDefinition, error)

DescribeTaskDefinition returns the task definition for the provided arn.

func (*AwsEcsAPIMock) ListServices

func (m *AwsEcsAPIMock) ListServices() ([]string, error)

ListServices returns the service arns of the current cluster.

Jump to

Keyboard shortcuts

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