Documentation ¶
Overview ¶
Package cli contains a reusable implemetation for a daemon that acts as a single node on the cluster.
Index ¶
- func ContextWithCancelOnSignal(ctx context.Context, signals ...os.Signal) context.Context
- type Command
- type Option
- func WithBaseOpts(o *opts.Opts) Option
- func WithCLIBaseName(n string) Option
- func WithCLIVersion(version, buildTime string) Option
- func WithKubernetesNodeVersion(v string) Option
- func WithPersistentFlags(flags *pflag.FlagSet) Option
- func WithPersistentPreRunCallback(f func() error) Option
- func WithProvider(name string, f provider.InitFunc) Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ContextWithCancelOnSignal ¶
ContextWithCancelOnSignal returns a context which will be cancelled when receiving one of the passed in signals. If no signals are passed in, the default signals SIGTERM and SIGINT are used.
Types ¶
type Command ¶
type Command struct {
// contains filtered or unexported fields
}
Command builds the CLI command
type Option ¶
type Option func(*Command)
Option sets an option on the command.
func WithCLIBaseName ¶
WithCLIBaseName sets the name of the command. This is used for things like help output.
If not set, the name is taken from `filepath.Base(os.Args[0])`
func WithCLIVersion ¶
WithCLIVersion sets the version details for the `version` subcommand.
func WithKubernetesNodeVersion ¶
WithKubernetesNodeVersion sets the version of kubernetes this should report as to the Kubernetes API server.
func WithPersistentFlags ¶
WithPersistentFlagsAllows you to attach custom, persitent flags to the command. The flags are added to the main command and all sub commands.
func WithPersistentPreRunCallback ¶
WithPersistentPreRunCallback adds a callback which is called after flags are processed but before running the command or any sub-command
Directories ¶
Path | Synopsis |
---|---|
internal
|
|
Package provider has the interfaces used by the the cli implementing a node
|
Package provider has the interfaces used by the the cli implementing a node |