tcli

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2026 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddDebugCommands

func AddDebugCommands() []action.AnyAction

AddDebugCommands returns standard operational CLI commands for probes and network tests.

Types

type CLIBinding

type CLIBinding struct {
	Command     string
	Aliases     []string
	Description string
	Examples    []string
}

CLIBinding maps an action to a command name, documentation, and examples.

func Command

func Command(cmd, desc string) CLIBinding

Command constructs a new CLI route binding.

func (CLIBinding) String

func (b CLIBinding) String() string

func (CLIBinding) WithAliases

func (b CLIBinding) WithAliases(aliases ...string) CLIBinding

WithAliases attaches alternative invocation aliases.

func (CLIBinding) WithExamples added in v0.2.0

func (b CLIBinding) WithExamples(examples ...string) CLIBinding

WithExamples attaches usage examples to the command help output.

type Option

type Option func(*Transport)

func WithArgs

func WithArgs(args ...string) Option

func WithCodec

func WithCodec(c codec.Codec) Option

func WithExecutable added in v0.2.0

func WithExecutable(name string) Option

WithExecutable overrides the binary name used in CLI help & usage output.

func WithOutput

func WithOutput(stdout, stderr io.Writer) Option

type Transport

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

func New

func New(opts ...Option) *Transport

func (*Transport) CanHandle

func (t *Transport) CanHandle(b action.Binding) bool

func (*Transport) Do

func (t *Transport) Do(ctx context.Context, _ any) (any, error)

func (*Transport) Mount

func (t *Transport) Mount(actions []action.AnyAction)

func (*Transport) PrintCommandHelp

func (t *Transport) PrintCommandHelp(act action.AnyAction)

func (*Transport) PrintHelp

func (t *Transport) PrintHelp()

func (*Transport) String

func (t *Transport) String() string

Jump to

Keyboard shortcuts

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