cmd

package
v0.0.107 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2020 License: Apache-2.0 Imports: 39 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrAbort = errors.New("abort")

Functions

func Execute

func Execute()

func GetRootCommand

func GetRootCommand() *cobra.Command

Types

type BoolFlagOpts

type BoolFlagOpts struct {
	Name        string
	Shorthand   string
	Description string
	Default     bool
	EnvName     string
	Hidden      bool
}

type CmdContext

type CmdContext struct {
	Client       *client.Client
	Config       flyctl.Config
	GlobalConfig flyctl.Config
	NS           string
	Args         []string
	Out          io.Writer
	Terminal     *terminal.Terminal
	WorkingDir   string
	ConfigFile   string

	AppName   string
	AppConfig *flyctl.AppConfig
}

func (*CmdContext) Render

func (ctx *CmdContext) Render(presentable presenters.Presentable) error

func (*CmdContext) RenderEx

func (ctx *CmdContext) RenderEx(presentable presenters.Presentable, options presenters.Options) error

func (*CmdContext) RenderView

func (ctx *CmdContext) RenderView(views ...PresenterOption) (err error)

func (*CmdContext) RenderViewW

func (ctx *CmdContext) RenderViewW(w io.Writer, views ...PresenterOption) error

type CmdOption

type CmdOption func(*Command) Initializer

type CmdRunFn

type CmdRunFn func(*CmdContext) error

type Command

type Command struct {
	*cobra.Command
}

func BuildCommand

func BuildCommand(parent *Command, fn CmdRunFn, usageText string, shortHelpText string, longHelpText string, out io.Writer, options ...CmdOption) *Command

func (*Command) AddBoolFlag

func (c *Command) AddBoolFlag(options BoolFlagOpts)

func (*Command) AddCommand

func (c *Command) AddCommand(commands ...*Command)

AddCommand adds subcommands to this command

func (*Command) AddStringFlag

func (c *Command) AddStringFlag(options StringFlagOpts)

func (*Command) AddStringSliceFlag added in v0.0.84

func (c *Command) AddStringSliceFlag(options StringSliceFlagOpts)

type Initializer

type Initializer struct {
	Setup  InitializerFn
	PreRun InitializerFn
}

type InitializerFn

type InitializerFn func(*CmdContext) error

type PresenterOption

type PresenterOption struct {
	Presentable presenters.Presentable
	Vertical    bool
	HideHeader  bool
	Title       string
}

type StringFlagOpts

type StringFlagOpts struct {
	Name        string
	Shorthand   string
	Description string
	Default     string
	EnvName     string
}

type StringSliceFlagOpts added in v0.0.84

type StringSliceFlagOpts struct {
	Name        string
	Shorthand   string
	Description string
	Default     []string
	EnvName     string
}

type TimingRequest added in v0.0.102

type TimingRequest struct {
	URL    string `json:"url"`
	Region string `json:"region"`
}

type TimingResponse added in v0.0.102

type TimingResponse struct {
	Err               error
	HTTPCode          int     `json:"http_code"`
	SpeedDownload     int     `json:"speed_download"`
	TimeTotal         float64 `json:"time_total"`
	TimeNameLookup    float64 `json:"time_namelookup"`
	TimeConnect       float64 `json:"time_connect"`
	TimePreTransfer   float64 `json:"time_pretransfer"`
	TimeAppConnect    float64 `json:"time_appconnect`
	TimeStartTransfer float64 `json:"time_starttransfer"`
	HTTPVersion       string  `json:"http_version"`
	RemoteIP          string  `json:"remote_ip"`
	Scheme            string  `json:"scheme"`
	Region            string  `json:"region"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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