Documentation
¶
Index ¶
- Constants
- Variables
- func AddContextValueSupplier(name string, supplier ContextValueSupplier)
- func GetModelDir(url string) (string, error)
- func Load(source Source) error
- func RegisterAction(name string, action LocalAction)
- func RegisterColumnFormatter(name string, formatter print.Formatter)
- func RegisterCommandType(name string, creator CommandMaker)
- type ColumnFormatterType
- type Command
- type CommandMaker
- type CommandModel
- type CommandType
- type ContextValueSupplier
- type ContextValues
- type FileSystemSource
- type GitSource
- type GroupCommand
- type LocalAction
- type LocalActionType
- type Model
- type OptionsCommand
- func (w *OptionsCommand) GetAPIClient() client.Interface
- func (w *OptionsCommand) GetCobraCommand() *cobra.Command
- func (w *OptionsCommand) GetUnauthenticatedAPIClient() client.Interface
- func (w *OptionsCommand) Initialize(c *cobra.Command, cm *CommandModel) Command
- func (w *OptionsCommand) PrintResult(n *jnode.Node)
- type ParameterDisposition
- type ParameterModel
- type ResultModel
- type Source
Constants ¶
View Source
const ( GetMethod = "GET" PostMethod = "POST" PatchMethod = "PATCH" DeleteMethod = "DELETE" )
View Source
const ( // Put the parameter value in the context ContextDisposition = ParameterDisposition("context") )
Variables ¶
View Source
var Models []*Model
Functions ¶
func AddContextValueSupplier ¶
func AddContextValueSupplier(name string, supplier ContextValueSupplier)
func GetModelDir ¶
func RegisterAction ¶
func RegisterAction(name string, action LocalAction)
func RegisterColumnFormatter ¶ added in v0.4.4
func RegisterCommandType ¶ added in v0.4.4
func RegisterCommandType(name string, creator CommandMaker)
Types ¶
type ColumnFormatterType ¶ added in v0.4.4
type ColumnFormatterType string
func (ColumnFormatterType) GetFormatter ¶ added in v0.4.4
func (t ColumnFormatterType) GetFormatter() print.Formatter
type CommandMaker ¶ added in v0.4.4
type CommandMaker func(c *cobra.Command, cm *CommandModel) Command
type CommandModel ¶
type CommandModel struct {
Type string `hcl:"type,label"`
Name string `hcl:"name,label"`
Use *string `hcl:"use"`
Short string `hcl:"short"`
Aliases *[]string `hcl:"aliases"`
Path *string `hcl:"path"`
Method *string `hcl:"method"`
Parameters []*ParameterModel `hcl:"parameter,block"`
ClusterIDOptional *bool `hcl:"cluster_id_optional"`
AuthNotRequired *bool `hcl:"auth_not_required"`
Unauthenticated *bool `hcl:"unauthenticated"`
Result *ResultModel `hcl:"result,block"`
Commands []*CommandModel `hcl:"command,block"`
// contains filtered or unexported fields
}
func (*CommandModel) GetCommand ¶
func (cm *CommandModel) GetCommand() Command
func (*CommandModel) GetCommandType ¶
func (cm *CommandModel) GetCommandType() CommandType
type CommandType ¶
type CommandType string
func (CommandType) IsGroup ¶
func (t CommandType) IsGroup() bool
type ContextValueSupplier ¶
type ContextValues ¶
type ContextValues struct {
// contains filtered or unexported fields
}
func NewContextValues ¶ added in v0.4.4
func NewContextValues() *ContextValues
type FileSystemSource ¶ added in v0.4.4
type FileSystemSource struct {
Filesystem http.FileSystem
RootPath string
}
func (*FileSystemSource) GetFileSystem ¶ added in v0.4.4
func (s *FileSystemSource) GetFileSystem() http.FileSystem
func (*FileSystemSource) GetPath ¶ added in v0.4.4
func (s *FileSystemSource) GetPath(name string) string
func (*FileSystemSource) GetVersion ¶ added in v0.4.4
func (s *FileSystemSource) GetVersion(name string, content []byte) string
func (*FileSystemSource) String ¶ added in v0.4.4
func (s *FileSystemSource) String() string
type GitSource ¶
type GitSource struct {
FileSystemSource
// contains filtered or unexported fields
}
type GroupCommand ¶ added in v0.4.4
func (*GroupCommand) GetAPIClient ¶ added in v0.4.4
func (g *GroupCommand) GetAPIClient() client.Interface
func (*GroupCommand) GetCobraCommand ¶ added in v0.4.4
func (g *GroupCommand) GetCobraCommand() *cobra.Command
func (*GroupCommand) GetUnauthenticatedAPIClient ¶ added in v0.4.4
func (g *GroupCommand) GetUnauthenticatedAPIClient() client.Interface
func (*GroupCommand) PrintResult ¶ added in v0.4.4
func (g *GroupCommand) PrintResult(n *jnode.Node)
func (*GroupCommand) SetContextValues ¶ added in v0.4.4
func (g *GroupCommand) SetContextValues(context map[string]string)
type LocalActionType ¶ added in v0.4.4
type LocalActionType string
type Model ¶
type Model struct {
Command CommandModel `hcl:"command,block"`
APIPrefix string `hcl:"api_prefix"`
MinCLIVersion *string `hcl:"min_cli_version"`
FileName string
Version string
}
type OptionsCommand ¶ added in v0.4.4
type OptionsCommand struct {
options.Interface
ClientOpts *options.ClientOpts
PrintOpts *options.PrintOpts
ClusterOpts *options.ClusterOpts
CobraCommand *cobra.Command
}
OptionsCommand is a command based on the options framework
func (*OptionsCommand) GetAPIClient ¶ added in v0.4.4
func (w *OptionsCommand) GetAPIClient() client.Interface
func (*OptionsCommand) GetCobraCommand ¶ added in v0.4.4
func (w *OptionsCommand) GetCobraCommand() *cobra.Command
func (*OptionsCommand) GetUnauthenticatedAPIClient ¶ added in v0.4.4
func (w *OptionsCommand) GetUnauthenticatedAPIClient() client.Interface
func (*OptionsCommand) Initialize ¶ added in v0.4.4
func (w *OptionsCommand) Initialize(c *cobra.Command, cm *CommandModel) Command
func (*OptionsCommand) PrintResult ¶ added in v0.4.4
func (w *OptionsCommand) PrintResult(n *jnode.Node)
type ParameterDisposition ¶
type ParameterDisposition string
What to do with a parameter. By default the parameter is put in the query string (for GET), or in the json body (everything else.)
type ParameterModel ¶
type ResultModel ¶
type ResultModel struct {
Path *[]string `hcl:"path"`
Columns *[]string `hcl:"columns"`
WideColumns *[]string `hcl:"wide_columns"`
Sort *[]string `hcl:"sort_by"`
Formatters *map[string]string `hcl:"formatters"`
LocalAction *string `hcl:"local_action"`
}
func (*ResultModel) GetFormatter ¶ added in v0.4.4
func (r *ResultModel) GetFormatter(column string) print.Formatter
Click to show internal directories.
Click to hide internal directories.