Documentation ¶
Index ¶
- Constants
- func ExactArgs(n int) cobra.PositionalArgs
- func GetHookGroups(env *EnvSettings) ([]*cobra.Command, templates.CommandGroups)
- func InStrings(a string, b []string) bool
- func MaximumNArgs(n int) cobra.PositionalArgs
- func MinimumNArgs(n int) cobra.PositionalArgs
- func Mkdir(path string) error
- func NewSettingsClient(env *EnvSettings) settings.Client
- func NoArgs(cmd *cobra.Command, args []string) error
- func RegisterCmd(in ...CmdOps) error
- func RegisterHooks(in []HookOps) error
- func SetFlagFromEnv(name, envName string, fs *pflag.FlagSet)
- func SplitArgs(args []string, argsLenAtDash int) ([]string, []string)
- type CmdOps
- type EnvSettings
- func (p *EnvSettings) ApiCall(method, uri string, param, body, output interface{}, ...) error
- func (p *EnvSettings) ApiCallDone(method, uri string, param, body, output interface{}, ...) (err error)
- func (p *EnvSettings) ApiPaging(uri string, param, body, output interface{}, opts ...cmdcli.RequestOption) error
- func (p *EnvSettings) GetClient(name string) *rest.RESTClient
- func (p *EnvSettings) Init(cmd *cobra.Command) error
- func (p EnvSettings) Output() *EnvSettingsOutput
- func (p *EnvSettings) Parse(fs *pflag.FlagSet, override map[string]string) error
- func (p *EnvSettings) Request(method, uri string, param, body, output interface{}, ...) (*cmdcli.Request, error)
- func (p EnvSettings) String() string
- func (p *EnvSettings) Write(b []byte) (int, error)
- type EnvSettingsOutput
- type HookOps
- type Preparer
- type Validator
Constants ¶
View Source
const ( CMD_G_GENERIC = iota CMD_G_RESOURCE CMD_G_DEUBG CMD_G_INTEGRATION CMD_G_SIZE )
View Source
const (
PRI_PKG
)
Variables ¶
This section is empty.
Functions ¶
func ExactArgs ¶
func ExactArgs(n int) cobra.PositionalArgs
ExactArgs returns an error if there are not exactly n args.
func GetHookGroups ¶
func GetHookGroups(env *EnvSettings) ([]*cobra.Command, templates.CommandGroups)
func MaximumNArgs ¶
func MaximumNArgs(n int) cobra.PositionalArgs
MaximumNArgs returns an error if there are more than N args.
func MinimumNArgs ¶
func MinimumNArgs(n int) cobra.PositionalArgs
MinimumNArgs returns an error if there is not at least N args.
func NewSettingsClient ¶
func NewSettingsClient(env *EnvSettings) settings.Client
func RegisterCmd ¶
func RegisterHooks ¶
func SetFlagFromEnv ¶
Types ¶
type EnvSettings ¶
type EnvSettings struct { Agent *config.Config In io.Reader Out io.Writer Errout io.Writer Client *rest.RESTClient Clients map[string]*rest.RESTClient // metrcs/cmd TopCmd *cobra.Command // contains filtered or unexported fields }
envSettings describes all of the environment settings.
func NewSettings ¶
func NewSettings(ctx context.Context) *EnvSettings
func (*EnvSettings) ApiCall ¶
func (p *EnvSettings) ApiCall(method, uri string, param, body, output interface{}, opts ...cmdcli.RequestOption) error
func (*EnvSettings) ApiCallDone ¶
func (p *EnvSettings) ApiCallDone(method, uri string, param, body, output interface{}, opts ...cmdcli.RequestOption) (err error)
func (*EnvSettings) ApiPaging ¶
func (p *EnvSettings) ApiPaging(uri string, param, body, output interface{}, opts ...cmdcli.RequestOption) error
func (*EnvSettings) GetClient ¶
func (p *EnvSettings) GetClient(name string) *rest.RESTClient
func (EnvSettings) Output ¶
func (p EnvSettings) Output() *EnvSettingsOutput
func (*EnvSettings) Request ¶
func (p *EnvSettings) Request(method, uri string, param, body, output interface{}, opts ...cmdcli.RequestOption) (*cmdcli.Request, error)
func (EnvSettings) String ¶
func (p EnvSettings) String() string
type EnvSettingsOutput ¶
Directories ¶
Path | Synopsis |
---|---|
Package standalone provides utility functions for Agent CLI commands that set up a new in-process Agent runtime (ex: check, jmx commands), as opposed to CLI commands that query a running Agent's IPC API.
|
Package standalone provides utility functions for Agent CLI commands that set up a new in-process Agent runtime (ex: check, jmx commands), as opposed to CLI commands that query a running Agent's IPC API. |
Click to show internal directories.
Click to hide internal directories.