commonlib

package
v0.0.0-...-eb664fc Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2016 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoSuchInstance      = errors.New("Instance does not exist")
	ErrTooManyReservations = errors.New("Instance has too many reservations")
	ErrTooManyInstances    = errors.New("Reservation has too many instances")
	ErrStartTimeout        = errors.New("Instance failed to start within 1 minute")
	ErrStopTimeout         = errors.New("Instance failed to stop within 5 minutes")
	ErrInstanceTerminated  = errors.New("Instance was terminated")
	ErrInstanceNotRunning  = errors.New("Instance is not running")

	ErrNamelessInstance = errors.New("Instance has no name")

	Mail               *MailConfig = nil
	DNSUpdaterInstance DNSUpdater  = nil

	DRYRUN = false
)

Functions

func DescribeOneInstance

func DescribeOneInstance(svc *ec2.EC2, params *ec2.DescribeInstancesInput) (*ec2.Instance, error)

func GetInstanceName

func GetInstanceName(instance *ec2.Instance) (string, error)

func RestartInstance

func RestartInstance(svc *ec2.EC2, id string) error

func SendMail

func SendMail(subject, body string) error

func SetDNS

func SetDNS(svc *ec2.EC2, id string) error

Types

type Checker

type Checker interface {
	Execute(*log.Entry)
	GetStatus() (bool, string)
}

type CreateCheckerFunc

type CreateCheckerFunc func(*ec2.EC2, yaml.MapSlice) (Checker, error)

type CreateDNSUpdaterFunc

type CreateDNSUpdaterFunc func(*session.Session, yaml.MapSlice) (DNSUpdater, error)

type DNSUpdater

type DNSUpdater interface {
	SetDNS(*ec2.Instance) error
}

type MailConfig

type MailConfig struct {
	Host      string         `yaml:"host"`
	Port      int            `yaml:"port"`
	StartTLS  bool           `yaml:"starttls"`
	Sender    string         `yaml:"sender"`
	Recipient string         `yaml:"recipient"`
	Auth      *MailPlainAuth `yaml:"auth"`
}

func (*MailConfig) Validate

func (self *MailConfig) Validate() error

type MailPlainAuth

type MailPlainAuth struct {
	Username string `yaml:"username"`
	Password string `yaml:"password"`
}

func (*MailPlainAuth) Validate

func (self *MailPlainAuth) Validate() error

Jump to

Keyboard shortcuts

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