Documentation ¶
Index ¶
- Variables
- func Execute(version string)
- func GetLogs(operation *GetLogsOperation)
- func Humanize(s string) string
- func Map(vs []string, f func(string) string) []string
- func Titleize(s string) string
- type ConsoleOutput
- func (c ConsoleOutput) Debug(msg string, a ...interface{})
- func (c ConsoleOutput) Fatal(err error, msg string, a ...interface{})
- func (c ConsoleOutput) Fatals(errs []error, msg string, a ...interface{})
- func (c ConsoleOutput) Info(msg string, a ...interface{})
- func (c ConsoleOutput) KeyValue(key, value string, indent int, a ...interface{})
- func (c ConsoleOutput) LineBreak()
- func (c ConsoleOutput) Say(msg string, indent int, a ...interface{})
- func (c ConsoleOutput) Table(header string, rows [][]string)
- func (c ConsoleOutput) Warn(msg string, a ...interface{})
- type Empty
- type GetLogsOperation
- func (o *GetLogsOperation) AddEndTime(rawEndTime string)
- func (o *GetLogsOperation) AddStartTime(rawStartTime string)
- func (o *GetLogsOperation) AddTasks(tasks []string)
- func (o *GetLogsOperation) GetStreamColor(logStreamName string) int
- func (o *GetLogsOperation) SeenEvent(eventId string) bool
- func (o *GetLogsOperation) Validate()
- type Output
- type Port
- type ScaleServiceOperation
- type ServiceDeployOperation
- type ServiceEnvListOperation
- type ServiceEnvSetOperation
- type ServiceEnvUnsetOperation
- type ServiceInfoOperation
- type ServiceProcessListOperation
- type ServiceRestartOperation
- type ServiceUpdateOperation
Examples ¶
Constants ¶
This section is empty.
Variables ¶
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 GetLogs ¶
func GetLogs(operation *GetLogsOperation)
func Humanize ¶ added in v0.3.0
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
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]
Types ¶
type ConsoleOutput ¶ added in v0.3.0
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 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 }
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 ScaleServiceOperation ¶
func (*ScaleServiceOperation) SetScale ¶
func (o *ScaleServiceOperation) SetScale(scaleExpression string)
type ServiceDeployOperation ¶
ServiceDeployOperation represents a deploy operation
type ServiceEnvListOperation ¶
type ServiceEnvListOperation struct {
ServiceName string
}
type ServiceEnvSetOperation ¶
func (*ServiceEnvSetOperation) SetEnvVars ¶
func (o *ServiceEnvSetOperation) SetEnvVars(inputEnvVars []string)
func (*ServiceEnvSetOperation) Validate ¶
func (o *ServiceEnvSetOperation) Validate()
type ServiceEnvUnsetOperation ¶
func (*ServiceEnvUnsetOperation) SetKeys ¶
func (o *ServiceEnvUnsetOperation) SetKeys(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()