Documentation ¶
Index ¶
- Constants
- type CmdContext
- func (commandContext *CmdContext) Frender(views ...PresenterOption) error
- func (commandContext *CmdContext) FrenderPrefix(prefix string, views ...PresenterOption) error
- func (commandContext *CmdContext) OutputJSON() bool
- func (commandContext *CmdContext) Render(presentable presenters.Presentable) error
- func (commandContext *CmdContext) Status(source string, status string, args ...interface{})
- func (commandContext *CmdContext) StatusLn()
- func (commandContext *CmdContext) Statusf(source string, status string, format string, args ...interface{})
- func (commandContext *CmdContext) WriteJSON(myData interface{})
- type JSON
- type PresenterOption
Constants ¶
View Source
const ( SINFO = "info" SWARN = "warning" SDETAIL = "detail" STITLE = "title" SBEGIN = "begin" SDONE = "done" SERROR = "error" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CmdContext ¶
type CmdContext struct { IO *iostreams.IOStreams Client *client.Client Config flyctl.Config GlobalConfig flyctl.Config NS string Args []string Command *cobra.Command Out io.Writer WorkingDir string ConfigFile string AppName string AppConfig *flyctl.AppConfig MachineConfig *api.MachineConfig }
CmdContext - context passed to commands being run
func NewCmdContext ¶
func (*CmdContext) Frender ¶
func (commandContext *CmdContext) Frender(views ...PresenterOption) error
Frender - render a view to a Writer
func (*CmdContext) FrenderPrefix ¶
func (commandContext *CmdContext) FrenderPrefix(prefix string, views ...PresenterOption) error
FrenderPrefix - render a view to a Writer
func (*CmdContext) OutputJSON ¶
func (commandContext *CmdContext) OutputJSON() bool
func (*CmdContext) Render ¶
func (commandContext *CmdContext) Render(presentable presenters.Presentable) error
Render - Render a presentable structure via the context
func (*CmdContext) Status ¶
func (commandContext *CmdContext) Status(source string, status string, args ...interface{})
func (*CmdContext) StatusLn ¶
func (commandContext *CmdContext) StatusLn()
func (*CmdContext) Statusf ¶
func (commandContext *CmdContext) Statusf(source string, status string, format string, args ...interface{})
func (*CmdContext) WriteJSON ¶
func (commandContext *CmdContext) WriteJSON(myData interface{})
type PresenterOption ¶
type PresenterOption struct { Presentable presenters.Presentable AsJSON bool Vertical bool HideHeader bool Title string }
Click to show internal directories.
Click to hide internal directories.