Documentation
¶
Overview ¶
Package command implements the common commands of the csharg CLI.
Index ¶
- Constants
- Variables
- func Annotate(fs *pflag.FlagSet, flagname, key, ann string)
- func DebugBeforeCommand(*cobra.Command) error
- func DebugSetupCLI(cmd *cobra.Command)
- func ListSetupCLI(cmd *cobra.Command)
- func NewSharkTank() (csharg.SharkTank, error)
- func OptionsSetupCLI(cmd *cobra.Command)
- func SetupCLI() *cobra.Command
- func VersionSetupCLI(cmd *cobra.Command)
Constants ¶
const ( // PodListTemplate defines the custom columns when listing only pods. PodListTemplate = "POD:{.Name}" // PodWideListTemplate defines the custom columns when listing only pods in // --wide mode. PodWideListTemplate = "POD:{.Name},NODE:{.NodeName}" // TargetListTemplate defines the custom columns when listing all types of // capture targets. TargetListTemplate = "TARGET:{.Name},TYPE:{.Type},NODE:{.NodeName}" // TargetWideListTemplate is like TargetListTemplate, but additionally tacks // on a column listing the capture service pod names. TargetWideListTemplate = "TARGET:{.Name},TYPE:{.Type},NODE:{.NodeName},SERVICE:{.CaptureService}" // NameListTemplate for handling "-o name" and only showing a custom "name" // column; this template should be used with no headers shown, as kubectl // and others do. NameListTemplate = "NAME:{.Name}" )
Builtin custom-columns templates
const ClientGroup = "sharktank"
ClientGroup is the name of an annotation value for flags that should be mutually exclusive for specifying capture service client endpoint information.
const MutualFlagGroupAnnotation = "mutually-exclusive-group"
Flag annotation for grouping mutually exclusive flags. Due to the open-ended plugin architecture of csharg we cannot directly use cobra's MarkFlagsMutuallyExclusive in plugins, but instead plugin need to annotate their flags and we then gather the groups with their flag members in order to issue MarkFlagsMutuallyExclusive as necessary.
Variables ¶
var BearerToken string
BearerToken specifies an optional user-supplied bearer token for authentication to be used with either the service URL.
var ReqTimeout time.Duration
ReqTimeout specifies the length of time to wait before giving up on a single server request.
Functions ¶
func DebugBeforeCommand ¶
DebugBeforeCommand enables debug logging when requested via the “--debug” flag.
func DebugSetupCLI ¶
DebugSetupCLI registers the “--debug” CLI flag.
func NewSharkTank ¶
NewSharkTank returns a suitable packetflix capture service client by asking the registered client factories one after another until the first one returns a client or an error.
func OptionsSetupCLI ¶
OptionsSetupCLI adds the "option" command.
func SetupCLI ¶
SetupCLI registers the global ("persistent") CLI flags, as well as the (sub)commands. The individual commands are registered via a plugin-mechanism.
func VersionSetupCLI ¶
VersionSetupCLI adds the “version” command.
Types ¶
This section is empty.