Documentation ¶
Overview ¶
Package tool contains utilities for creating Service Weaver tools similar to weaver-multi, weaver-gke, and weaver-gke-local.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FlagsHelp ¶
FlagsHelp pretty prints the set of flags in the provided FlagSet, along with their descriptions and default values. Here's an example output:
-h, --help Print this help message. --follow Act like tail -f (default false) --format Output format (pretty or json) (default pretty) --system Show system internal logs (default false)
Types ¶
type Command ¶
type Command struct { Name string // subcommand name Description string // short one-line description Help string // full help message Flags *flag.FlagSet // flags Fn func(context.Context, []string) error // passed command line args that occur after the subcommmand name Hidden bool // hide from help messages? }
Command is a subcommand of a binary, like the "add" in "git add".
type LogsSpec ¶
type LogsSpec struct { Tool string // tool name, e.g., "weaver gke" Flags *flag.FlagSet // optional additional flags Rewrite func(logging.Query) (logging.Query, error) // optional query preprocessing Source func(context.Context) (logging.Source, error) // returns log source // contains filtered or unexported fields }
LogSpec configures the command returned by LogsCmd.
Click to show internal directories.
Click to hide internal directories.