cmd

package
v2.3.1 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Args

type Args struct {
	In           io.Reader
	Out          io.Writer
	Args         map[string]any
	ContextItems map[string]any
}

type Command

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

type Option

type Option func(options *Options)

func WithArgs

func WithArgs(args map[string]any) Option

func WithConfig

func WithConfig(key string, cfg any) Option

func WithConfigDefault

func WithConfigDefault(cfg any) Option

func WithContextItems

func WithContextItems(items map[string]any) Option

func WithInput

func WithInput(in io.Reader) Option

func WithOutput

func WithOutput(in io.Writer) Option

func WithTimeout

func WithTimeout(wait time.Duration) Option

type Options

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

type Result

type Result int
const (
	Done Result = iota
	Timeout
)

func StartCommand

func StartCommand(tb testing.TB, ctx context.Context, root *cobra.Command, opts ...Option) Result

Jump to

Keyboard shortcuts

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