Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Flags = GlobalFlags{ Filter: "", Format: formatText, Save: "", Host: "", HostNetworkKey: "", Network: config.DefaultEmulatorNetwork().Name, Log: logLevelInfo, Yes: false, ConfigPaths: config.DefaultPaths(), }
Flags initialized to default values.
Functions ¶
func ContainsFlag ¶ added in v0.21.0
ContainsFlag checks if output flag is present for the provided field.
Types ¶
type Command ¶
type Command struct { Cmd *cobra.Command Flags interface{} Run Run RunS RunWithState }
func (Command) AddToParent ¶
AddToParent add new command to main parent cmd and initializes all necessary things as well as take care of errors and output here we can do all boilerplate code that is else copied in each command and make sure we have one place to handle all errors and ensure commands have consistent results.
type GlobalFlags ¶
type GlobalFlags struct { Filter string Format string Save string Host string HostNetworkKey string Log string Network string Yes bool ConfigPaths []string }
GlobalFlags contains all global flags definitions.
type Result ¶
type Result interface { // String will output the result in human readable output. String() string // Oneliner will output the result in "grep-able" format. Oneliner() string // JSON will output the result in JSON format JSON() interface{} }
Result interface describes all the formats for the result output.
type Run ¶ added in v0.24.0
type Run func( args []string, readerWriter flowkit.ReaderWriter, globalFlags GlobalFlags, services *services.Services, ) (Result, error)
Run the command with arguments.
type RunWithState ¶ added in v0.24.0
type RunWithState func( args []string, readerWriter flowkit.ReaderWriter, globalFlags GlobalFlags, services *services.Services, state *flowkit.State, ) (Result, error)
RunWithState runs the command with arguments and state.
Click to show internal directories.
Click to hide internal directories.