descriptor

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2020 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrDescriptorNotFound = errors.New("descriptor not found")

Functions

func Descriptors

func Descriptors() []string

func Register

func Register(name string, descriptor Descriptor)

Types

type Command

type Command struct {
	Bin         string
	Name        string
	Description string
	Help        string
	Definition  *input.Definition
}

type Commands

type Commands struct {
	Namespace  string
	Definition *input.Definition
	Commands   []NSCommand
}

type Descriptor

type Descriptor interface {
	Command(ctx context.Context, out output.Output, cmd Command) error
	Commands(ctx context.Context, out output.Output, cmds Commands) error
}

func Find

func Find(name string) (Descriptor, error)

type NSCommand

type NSCommand struct {
	Name     string
	Commands []ShortCommand
}

func (*NSCommand) Append

func (n *NSCommand) Append(name, desc string)

type ShortCommand

type ShortCommand struct {
	Name        string
	Description string
}

Jump to

Keyboard shortcuts

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