aws

package
v0.0.0-...-623a9b7 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2015 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	STATUS_RUNNING = 1 << iota
	STATUS_STOPPING
	STATUS_STOPPED
	STATUS_SHUTTING_DOWN
	STATUS_TERMINATED
	STATUS_PENDING
	STATUS_UNKNOWN
)

event types

Variables

This section is empty.

Functions

This section is empty.

Types

type EC2EventsInterface

type EC2EventsInterface interface {
	// Add a event listener for terminated instances
	AddEventListener(int) EventCh
	// Get running hosts
	GetRunningHosts() map[string]string
}

EC2EventsInterface ... the interface for a instance listener

func NewEC2EventsInterface

func NewEC2EventsInterface(awsKey, awsSecret, awsRegion, awsEnv string) (EC2EventsInterface, error)

NewEC2EventsInterface ... Creates a new EC2InstanceInterface to consume events from

type EC2Interface

type EC2Interface interface {
	// Get a complete list of instances
	DescribeInstances(*ec2.Filter) ([]ec2.Instance, error)
	// Get running instances
	DescribeRunning() ([]ec2.Instance, error)
	// Get terminated instances
	DescribeTerminated() ([]ec2.Instance, error)
	// Get all instances
	DescribeAll() ([]ec2.Instance, error)
	// terminate the instance
	TerminatedInstance(string) error
	// check the instance exists
	Exists(string) (bool, error)
}

EC2Interface ... a helper interface to ec2 instances

func NewEC2Interface

func NewEC2Interface(awsKey, awsSecret, awsRegion, envTag string) (EC2Interface, error)

NewEC2Interface ... Creates a new EC2 Helper interface

type EventCh

type EventCh chan *InstanceEvent

EventCh ... a channel to receive events upon

type InstanceEvent

type InstanceEvent struct {
	// the instance id
	InstanceID string
	// the event type
	EventType int
	// the instance if required
	Instance ec2.Instance
}

InstanceEvent ... the stucture for a instance event

func (InstanceEvent) String

func (r InstanceEvent) String() string

Jump to

Keyboard shortcuts

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