cmd

package
v0.0.0-...-99e5c20 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 20, 2025 License: Apache-2.0 Imports: 62 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Execute

func Execute()

Execute adds all child commands to the root command and sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd.

func IsJSON

func IsJSON(str string) bool

Types

type CommandOptions

type CommandOptions interface {
	Prepare(cmd *cobra.Command, args []string) error
	Run(cmd *cobra.Command) error
}

Base interface for a options-based command. Take a look at any of the structs implementing commands to see how this should be used.

type DatabaseSnapshotMetadata

type DatabaseSnapshotMetadata struct {
	Version      int       `json:"version"`
	Environment  string    `json:"environment"`
	DatabaseName string    `json:"database_name"`
	NumShards    int       `json:"num_shards"`
	ExportedAt   time.Time `json:"exported_at"`
}

DatabaseSnapshotMetadata contains information about the database export

type IOStreams

type IOStreams struct {
	In     io.Reader
	Out    io.Writer
	ErrOut io.Writer
}

IOStreams holds the IO streams for remote terminal streaming

type LogEntry

type LogEntry struct {
	// contains filtered or unexported fields
}

type PositionalArgSpec

type PositionalArgSpec struct {
	Name        string  // Name of the argument (eg, ENVIRONMENT)
	Description string  // Description of the argument
	IsRequired  bool    // Is the argument required (or optional)?
	ValuePtr    *string // Pointer to the parsed value. \todo support more types?
}

type PositionalArgs

type PositionalArgs struct {
	Specs                []PositionalArgSpec // Array of arguments for the command
	ExtraArgsPtr         *[]string           // Pointer to extra args (if specified)
	ExtraArgsDescription string              // Description of extra args (if any)
}

func (*PositionalArgs) AddStringArgument

func (args *PositionalArgs) AddStringArgument(valuePtr *string, name string, description string)

func (*PositionalArgs) AddStringArgumentOpt

func (args *PositionalArgs) AddStringArgumentOpt(valuePtr *string, name string, description string)

func (*PositionalArgs) GetHelpText

func (args *PositionalArgs) GetHelpText() string

func (*PositionalArgs) ParseCommandLine

func (args *PositionalArgs) ParseCommandLine(argv []string) error

func (*PositionalArgs) SetExtraArgs

func (args *PositionalArgs) SetExtraArgs(extraArgsPtr *[]string, description string)

type UsePositionalArgs

type UsePositionalArgs struct {
	// contains filtered or unexported fields
}

func (*UsePositionalArgs) Arguments

func (o *UsePositionalArgs) Arguments() *PositionalArgs

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL