ecsclient

package
v0.0.0-...-8a57589 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2017 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package ecsclient provides a wrapper around the ECS and EC2 apis to provide useful helper functions for this program

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AugmentedContainer

type AugmentedContainer interface {
	ContainerPorts(string) []uint16
	ResolvePort(uint16) uint16
	Running() bool
	ECSContainer() *ecs.Container
}

AugmentedContainer is a container that has been augmented with additioanl convenience methods

type AugmentedTask

type AugmentedTask interface {
	PublicIP() string
	PrivateIP() string
	Container(string) AugmentedContainer
	ECSTask() *ecs.Task
	EC2Instance() *ec2.Instance
}

AugmentedTask is a task that has been augmented with additional convenience methods.

type ECSClient

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

ECSClient implements ECSSimpleClient. It is exposed for cross-package testing

func (*ECSClient) Tasks

func (c *ECSClient) Tasks(family, service *string) ([]AugmentedTask, error)

Tasks returns an array of tasks filtered optionally by family or service. The returned Task will be augmented with an EC2 instance element if an instance can be successfully associated.

type ECSSimpleClient

type ECSSimpleClient interface {
	Tasks(family, serviceName *string) ([]AugmentedTask, error)
}

ECSSimpleClient is an abstraction over the ECS API that does the following:

  1. Combines list+describe for you, handily dealing with any pagination and chunking.
  2. Describes the underlying EC2 instance and provides it via the EC2Instance field of the returned structs

func New

func New(cluster string, region string, ecsclient ecsiface.ECSAPI, ec2client ec2iface.EC2API) ECSSimpleClient

New creates a new ECSSimpleClient. The 'ecsclient' and 'ec2client' arguments may both be nil in which case they will be constructed for you. If region is the empty string, it will be inferred from the environment or instance metadata service (in that order of preference). If a region cannot be found, this function will panic.

Directories

Path Synopsis
ec2
ecs

Jump to

Keyboard shortcuts

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