cmd

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2020 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Index

Examples

Constants

This section is empty.

Variables

View Source
var InvalidCpuAndMemoryCombination = fmt.Errorf(`Invalid CPU and Memory settings

CPU (CPU Units)    Memory (MiB)
---------------    ------------
256                512, 1024, or 2048
512                1024 through 4096 in 1GiB increments
1024               2048 through 8192 in 1GiB increments
2048               4096 through 16384 in 1GiB increments
4096               8192 through 30720 in 1GiB increments
`)

Functions

func Execute

func Execute(version string)

Execute ...

func GetLogs

func GetLogs(operation *GetLogsOperation)

func Humanize added in v0.3.0

func Humanize(s string) string

Humanize takes strings intended for machines and prettifies them for humans.

Example
fmt.Println(Humanize("HELLO_COMPUTER"))
Output:

hello computer

func Map added in v0.3.0

func Map(vs []string, f func(string) string) []string

Map applies a func to all members of a slice of strings and returns a new slice of the results.

Example
reverse := func(s string) string {
	r := []rune(s)
	for i, j := 0, len(r)-1; i < len(r)/2; i, j = i+1, j-1 {
		r[i], r[j] = r[j], r[i]
	}
	return string(r)
}

fmt.Printf("%v", Map([]string{"Pippin", "Merry"}, reverse))
Output:

[nippiP yrreM]

func Titleize added in v0.3.0

func Titleize(s string) string

Titleize humanizes a string and returns it in Title Case.

Example
fmt.Println(Titleize("HELLO_COMPUTER"))
Output:

Hello Computer

Types

type ConsoleOutput added in v0.3.0

type ConsoleOutput struct {
	Color   bool
	Emoji   bool
	Verbose bool
	Test    bool
}

ConsoleOutput implements a channel for sending messages to a user over standard output.

func (ConsoleOutput) Debug added in v0.3.0

func (c ConsoleOutput) Debug(msg string, a ...interface{})

Debug prints a formatted message to standard output if `Verbose` is set to `true`. Messages are prefixed to indicate they are for debugging with :wrench: or [d].

Example
consoleOutput.Debug("PC LOAD LETTER")
Output:

[d] PC LOAD LETTER

func (ConsoleOutput) Fatal added in v0.3.0

func (c ConsoleOutput) Fatal(err error, msg string, a ...interface{})

Fatal prints a formatted message and an error string to standard output Messages are prefixed to indicate they are fatals with :warning: or [!].

Example
err := errors.New("OXY2_TANK_EXPLOSION")
consoleOutput.Fatal(err, "Houston, we've had a problem.")
Output:

[!] Houston, we've had a problem.
    - OXY2_TANK_EXPLOSION

func (ConsoleOutput) Fatals added in v0.3.0

func (c ConsoleOutput) Fatals(errs []error, msg string, a ...interface{})

Fatals prints a formatted message and one or more error strings to standard output. Messages are prefixed to indicate they are fatals with :warning: or [!].

Example
errs := []error{
	errors.New("OXY2_TANK_EXPLOSION"),
	errors.New("PRIM_FUEL_CELL_FAILURE"),
	errors.New("SEC_FUEL_CELL_FAILURE"),
}
consoleOutput.Fatals(errs, "Houston, we've had a problem.")
Output:

[!] Houston, we've had a problem.
    - OXY2_TANK_EXPLOSION
    - PRIM_FUEL_CELL_FAILURE
    - SEC_FUEL_CELL_FAILURE

func (ConsoleOutput) Info added in v0.3.0

func (c ConsoleOutput) Info(msg string, a ...interface{})

Info prints a formatted message to standard output. Messages are prefixed to indicate they are informational with :information_source: or [i].

Example
consoleOutput.Info("Welcome! Everything is %s.", "fine")
Output:

[i] Welcome! Everything is fine.

func (ConsoleOutput) KeyValue added in v0.3.0

func (c ConsoleOutput) KeyValue(key, value string, indent int, a ...interface{})

KeyValue prints a formatted, optionally indented key and value pair to standard output.

Example
population := 468730

consoleOutput.KeyValue("Name", "Staten Island", 0)
consoleOutput.KeyValue("County", "Richmond", 1)
consoleOutput.KeyValue("Population", "%d", 1, population)
Output:

Name: Staten Island
    County: Richmond
    Population: 468730

func (ConsoleOutput) LineBreak added in v0.3.0

func (c ConsoleOutput) LineBreak()

LineBreak prints a single line break.

func (ConsoleOutput) Say added in v0.3.0

func (c ConsoleOutput) Say(msg string, indent int, a ...interface{})

Say prints an optionally indented, formatted message followed by a line break to standard output.

Example
username := "Werner Brandes"
consoleOutput.Say("Hi, my name is %s. My voice is my passport. Verify Me.", 0, username)
Output:

Hi, my name is Werner Brandes. My voice is my passport. Verify Me.

func (ConsoleOutput) Table added in v0.3.0

func (c ConsoleOutput) Table(header string, rows [][]string)

Table prints a formatted table with optional header to standard output.

Example
rows := [][]string{
	{"NAME", "ALLEGIANCE"},
	{"Butterbumps", "House Tyrell"},
	{"Jinglebell", "House Frey"},
	{"Moon Boy", "House Baratheon"},
}

consoleOutput.Table("Fools of Westeros", rows)
Output:

Fools of Westeros

NAME		ALLEGIANCE
Butterbumps	House Tyrell
Jinglebell	House Frey
Moon Boy	House Baratheon

func (ConsoleOutput) Warn added in v0.3.0

func (c ConsoleOutput) Warn(msg string, a ...interface{})

Warn prints a formatted message to standard output. Messages are prefixed to indicate they are warnings with :warning: or [!].

Example
consoleOutput.Warn("Keep it secret, keep it safe.")
Output:

[!] Keep it secret, keep it safe.

type Empty

type Empty struct{}

type GetLogsOperation

type GetLogsOperation struct {
	LogGroupName      string
	Namespace         string
	EndTime           time.Time
	Filter            string
	Follow            bool
	LogStreamColors   map[string]int
	LogStreamNames    []string
	StartTime         time.Time
	EventCache        *lru.Cache
	IncludeTime       bool
	NoLogStreamPrefix bool
}

func (*GetLogsOperation) AddEndTime

func (o *GetLogsOperation) AddEndTime(rawEndTime string)

func (*GetLogsOperation) AddStartTime

func (o *GetLogsOperation) AddStartTime(rawStartTime string)

func (*GetLogsOperation) AddTasks

func (o *GetLogsOperation) AddTasks(tasks []string)

func (*GetLogsOperation) GetStreamColor

func (o *GetLogsOperation) GetStreamColor(logStreamName string) int

func (*GetLogsOperation) SeenEvent

func (o *GetLogsOperation) SeenEvent(eventId string) bool

func (*GetLogsOperation) Validate

func (o *GetLogsOperation) Validate()

type Output added in v0.3.0

type Output interface {
	Debug(string, ...interface{})
	Fatal(error, string, ...interface{})
	Fatals([]error, string, ...interface{})
	Info(string, ...interface{})
	KeyValue(string, string, int, ...interface{})
	LineBreak()
	Say(string, int, ...interface{})
	Table(string, [][]string)
	Warn(string, ...interface{})
}

Output represents a channel for sending messages to a user.

type Port

type Port struct {
	Number   int64
	Protocol string
}

func (Port) Empty added in v0.2.1

func (p Port) Empty() bool

func (Port) String added in v0.2.1

func (p Port) String() string

type ScaleServiceOperation

type ScaleServiceOperation struct {
	ServiceName  string
	DesiredCount int64
}

func (*ScaleServiceOperation) SetScale

func (o *ScaleServiceOperation) SetScale(scaleExpression string)

type ServiceDeployOperation

type ServiceDeployOperation struct {
	ServiceName    string
	Image          string
	ComposeFile    string
	Region         string
	Revision       string
	WaitForService bool
}

ServiceDeployOperation represents a deploy operation

type ServiceEnvListOperation

type ServiceEnvListOperation struct {
	ServiceName string
}

type ServiceEnvSetOperation

type ServiceEnvSetOperation struct {
	ServiceName string
	EnvVars     []ECS.EnvVar
	SecretVars  []ECS.Secret
}

func (*ServiceEnvSetOperation) SetEnvVars

func (o *ServiceEnvSetOperation) SetEnvVars(inputEnvVars []string, envVarFile string)

func (*ServiceEnvSetOperation) SetSecretVars added in v0.6.0

func (o *ServiceEnvSetOperation) SetSecretVars(inputSecretVars []string, secretVarFile string)

func (*ServiceEnvSetOperation) Validate

func (o *ServiceEnvSetOperation) Validate()

type ServiceEnvUnsetOperation

type ServiceEnvUnsetOperation struct {
	ServiceName string
	Keys        []string
}

func (*ServiceEnvUnsetOperation) Validate

func (o *ServiceEnvUnsetOperation) Validate()

type ServiceInfoOperation

type ServiceInfoOperation struct {
	ServiceName string
}

type ServiceProcessListOperation

type ServiceProcessListOperation struct {
	ServiceName string
}

type ServiceRestartOperation

type ServiceRestartOperation struct {
	ServiceName string
}

type ServiceUpdateOperation

type ServiceUpdateOperation struct {
	ServiceName string
	Cpu         string
	Memory      string
	Service     ECS.Service
}

func (*ServiceUpdateOperation) Validate

func (o *ServiceUpdateOperation) Validate()

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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