Documentation ¶
Overview ¶
Package cmd defines the cobra command structs and an execution method for adding an improved CLI to KrakenD based api gateways
Index ¶
- Variables
- func Execute(configParser config.Parser, f Executor)
- func ExecuteRoot(configParser config.Parser, f Executor, root Root)
- func GetConfigFlag() string
- func GetConfigParser() config.Parser
- func GetDebugFlag() bool
- type Command
- type Executor
- type FlagBuilder
- func BoolFlagBuilder(dst *bool, long, short string, defaultValue bool, help string) FlagBuilder
- func CountFlagBuilder(dst *int, long, short string, help string) FlagBuilder
- func DurationFlagBuilder(dst *time.Duration, long, short string, defaultValue time.Duration, ...) FlagBuilder
- func Float64FlagBuilder(dst *float64, long, short string, defaultValue float64, help string) FlagBuilder
- func IntFlagBuilder(dst *int, long, short string, defaultValue int, help string) FlagBuilder
- func StringFlagBuilder(dst *string, long, short, defaultValue, help string) FlagBuilder
- type Root
Constants ¶
This section is empty.
Variables ¶
View Source
var ( DefaultRoot Root RootCommand Command RunCommand Command CheckCommand Command PluginCommand Command VersionCommand Command )
View Source
var SchemaURL = "https://www.krakend.io/schema/v3.json"
Functions ¶
func Execute ¶
Execute sets up the cmd package with the received configuration parser and executor and delegates the CLI execution to the cobra lib
func GetConfigFlag ¶
func GetConfigFlag() string
func GetConfigParser ¶
func GetDebugFlag ¶
func GetDebugFlag() bool
Types ¶
type Command ¶
type Command struct { Cmd *cobra.Command Flags []FlagBuilder // contains filtered or unexported fields }
func NewCommand ¶
func NewCommand(command *cobra.Command, flags ...FlagBuilder) Command
func (*Command) AddFlag ¶
func (c *Command) AddFlag(f FlagBuilder)
func (*Command) AddSubCommand ¶
func (*Command) BuildFlags ¶
func (c *Command) BuildFlags()
type Executor ¶
type Executor func(config.ServiceConfig)
Executor defines the function that requires a service description
type FlagBuilder ¶
func BoolFlagBuilder ¶
func BoolFlagBuilder(dst *bool, long, short string, defaultValue bool, help string) FlagBuilder
func CountFlagBuilder ¶
func CountFlagBuilder(dst *int, long, short string, help string) FlagBuilder
func DurationFlagBuilder ¶
func Float64FlagBuilder ¶
func Float64FlagBuilder(dst *float64, long, short string, defaultValue float64, help string) FlagBuilder
func IntFlagBuilder ¶
func IntFlagBuilder(dst *int, long, short string, defaultValue int, help string) FlagBuilder
func StringFlagBuilder ¶
func StringFlagBuilder(dst *string, long, short, defaultValue, help string) FlagBuilder
Click to show internal directories.
Click to hide internal directories.