{"modulePath":"github.com/elotl/node-cli","version":"v0.1.3-elotl1","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package cli\n\nPackage cli contains a reusable implemetation for a daemon that acts as a single node on the cluster.\n\n## Functions\n\n```go\nfunc ContextWithCancelOnSignal(ctx context.Context, signals ...os.Signal) context.Context\n```\nContextWithCancelOnSignal 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.\n\n## Types\n\n```go\ntype Command struct {\n\t// contains filtered or unexported fields\n}\n```\nCommand builds the CLI command\n\n```go\nfunc New(ctx context.Context, options ...Option) (*Command, error)\n```\nNew creates a new command. Call \\`Run()\\` on the returned object to run the command.\n\n```go\nfunc (c *Command) Run(ctx context.Context, args ...string) error\n```\nRun executes the command with the provided args. If args is nil then os.Args\\[1:] is used\n\n```go\ntype Option func(*Command)\n```\nOption sets an option on the command.\n\n```go\nfunc WithBaseOpts(o *opts.Opts) Option\n```\nWithBaseOpts sets the base options used\n\n```go\nfunc WithCLIBaseName(n string) Option\n```\nWithCLIBaseName sets the name of the command. This is used for things like help output.\n\nIf not set, the name is taken from \\`filepath.Base(os.Args\\[0])\\`\n\n```go\nfunc WithCLIVersion(version, buildTime string) Option\n```\nWithCLIVersion sets the version details for the \\`version\\` subcommand.\n\n```go\nfunc WithKubernetesNodeVersion(v string) Option\n```\nWithKubernetesNodeVersion sets the version of kubernetes this should report as to the Kubernetes API server.\n\n```go\nfunc WithPersistentFlags(flags *pflag.FlagSet) Option\n```\nWithPersistentFlagsAllows you to attach custom, persitent flags to the command. The flags are added to the main command and all sub commands.\n\n```go\nfunc WithPersistentPreRunCallback(f func() error) Option\n```\nWithPersistentPreRunCallback adds a callback which is called after flags are processed but before running the command or any sub-command\n\n```go\nfunc WithProvider(name string, f provider.InitFunc) Option\n```\nWithProvider registers a provider which the cli can be initialized with.\n\n","path":"github.com/elotl/node-cli","name":"cli","synopsis":"Package cli contains a reusable implemetation for a daemon that acts as a single node on the cluster.","isRedistributable":true}
