Documentation ¶
Overview ¶
Copyright 2018 GRAIL, Inc. All rights reserved. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
Package tool implements the reflow command.
Index ¶
- type Cmd
- func (c *Cmd) CurrentPool(ctx context.Context) pool.Pool
- func (c *Cmd) Errorf(format string, v ...interface{})
- func (c Cmd) Errorln(v ...interface{})
- func (c *Cmd) Exit(code int)
- func (c *Cmd) Fatal(v ...interface{})
- func (c *Cmd) Fatalf(format string, v ...interface{})
- func (c *Cmd) Flags() *flag.FlagSet
- func (c *Cmd) Main()
- func (c *Cmd) Parse(fs *flag.FlagSet, args []string, help, usage string)
- func (c *Cmd) Printf(format string, v ...interface{})
- func (c *Cmd) Println(v ...interface{})
- func (c *Cmd) TransferLimit() int
- func (c Cmd) WaitForBackgroundTasks(wg *wg.WaitGroup, timeout time.Duration)
- type Cost
- type Func
- type OfferInspect
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cmd ¶
type Cmd struct { // Schema is the infrastructure schema. Schema infra.Schema // SchemaKeys is the schema keys to providers,flags. SchemaKeys infra.Keys // Config must be specified. Config infra.Config DefaultConfigFile string Version string Variant string // Commands contains the additional set of invocable commands. Commands map[string]Func // ConfigFile stores the path of the active configuration file. // May be overridden by the -config flag. ConfigFile string // Intro is an additional introduction printed after the standard one. Intro string // The standard output and error as defined by this command; // these are wrapped through a status writer so that output is // properly interleaved. Stdout, Stderr io.Writer // Status object for the current cmd invocation. This is used to continuously update the // progress of the cmd execution. Status *status.Status // BootstrapBinary stores the path of the bootstrap binary. BootstrapBinary string Log *log.Logger // contains filtered or unexported fields }
Cmd holds the configuration, flag definitions, and runtime objects required for tool invocations.
func (*Cmd) CurrentPool ¶
CurrentPool returns the current underlying pool of an ec2cluster. The returned pool reflects the current state of the remote ec2cluster as long as the provided ctx is not done. Note that any existing allocs in the current pool are not "kept alive", so it is only useful for tools performing introspection of the state of the pool.
func (Cmd) Errorln ¶
func (c Cmd) Errorln(v ...interface{})
Errorln formats a message in the manner of fmt.Println and prints it to stderr.
func (*Cmd) Exit ¶
Exit causes the command to exit with the provided status code. Exit ensures that command teardown is properly handled.
func (*Cmd) Fatal ¶
func (c *Cmd) Fatal(v ...interface{})
Fatal formats a message in the manner of fmt.Print, prints it to stderr, and then exits the tool.
func (*Cmd) Fatalf ¶
Fatalf formats a message in the manner of fmt.Printf, prints it to stderr, and then exits the tool.
func (*Cmd) Flags ¶
Flags initializes and returns the FlagSet used by this Cmd instance. The user should parse this flagset before invoking (*Cmd).Main, e.g.:
cmd.Flags().Parse(os.Args[1:])
func (*Cmd) Main ¶
func (c *Cmd) Main()
Main parses command line flags and then invokes the requested command. Main uses Cmd's config (and other initialization), which may be overridden by flag configs. It should be invoked only once, at the beginning of command line execution. The caller is expected to have parsed the flagset for us before calling Main.
Main should only be called once.
func (*Cmd) Parse ¶
Parse parses the provided FlagSet from the provided arguments. It adds a -help flag to the flagset, and prints the help and usage string when the command is called with -help. On usage error, it prints the flag defaults and exits with code 2.
func (*Cmd) Println ¶
func (c *Cmd) Println(v ...interface{})
Println formats a message in the manner of fmt.Println and prints it to stdout.
func (*Cmd) TransferLimit ¶
TransferLimit returns the configured transfer limit.
type Cost ¶
type Cost struct {
// contains filtered or unexported fields
}
Cost tracks the cost of something along with whether its an exact cost.
type OfferInspect ¶
OfferInspect contains Offer metadata.