cmd

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Code generated by github.com/light-speak/lighthouse, YOU CAN FUCKING EDIT BY YOURSELF.

Code generated by github.com/light-speak/lighthouse, YOU CAN FUCKING EDIT BY YOURSELF.

Code generated by github.com/light-speak/lighthouse, YOU CAN FUCKING EDIT BY YOURSELF.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddCommand

func AddCommand(command CommandInterface)

func GetArgs

func GetArgs(argDefs []*CommandArg, flagValues map[string]interface{}) (map[string]interface{}, error)

func GetBoolArg

func GetBoolArg(args map[string]interface{}, name string) (*bool, error)

GetBoolArg gets a bool argument from the flag values

func GetDefaultValue

func GetDefaultValue(argDef *CommandArg) interface{}

func GetIntArg

func GetIntArg(args map[string]interface{}, name string) (*int, error)

GetIntArg gets an int argument from the flag values

func GetStringArg

func GetStringArg(args map[string]interface{}, name string) (*string, error)

GetStringArg gets a string argument from the flag values

func GetTypeName

func GetTypeName(argType CommandArgType) string

func Run

func Run(c CommandListInterface, args []string) error

Types

type Command

type Command struct{}

func (*Command) GetCommands

func (c *Command) GetCommands() []CommandInterface

type CommandArg

type CommandArg struct {
	Name     string
	Type     CommandArgType
	Usage    string
	Required bool
	Default  interface{}
}

type CommandArgType

type CommandArgType int
const (
	String CommandArgType = iota
	Int
	Bool
)

type CommandInterface

type CommandInterface interface {
	Name() string
	Usage() string
	Args() []*CommandArg
	Action() func(flagValues map[string]interface{}) error
	OnExit() func()
}

type CommandListInterface

type CommandListInterface interface {
	GetCommands() []CommandInterface
}

type GenCmd

type GenCmd struct{}

func (*GenCmd) Action

func (c *GenCmd) Action() func(flagValues map[string]interface{}) error

func (*GenCmd) Args

func (c *GenCmd) Args() []*CommandArg

func (*GenCmd) Name

func (c *GenCmd) Name() string

func (*GenCmd) OnExit

func (c *GenCmd) OnExit() func()

func (*GenCmd) Usage

func (c *GenCmd) Usage() string

type Generate

type Generate struct{}

func (*Generate) Action

func (c *Generate) Action() func(flagValues map[string]interface{}) error

func (*Generate) Args

func (c *Generate) Args() []*CommandArg

func (*Generate) Name

func (c *Generate) Name() string

func (*Generate) OnExit

func (c *Generate) OnExit() func()

func (*Generate) Usage

func (c *Generate) Usage() string

type GenerateTask

type GenerateTask struct{}

func (*GenerateTask) Action

func (c *GenerateTask) Action() func(flagValues map[string]interface{}) error

func (*GenerateTask) Args

func (c *GenerateTask) Args() []*CommandArg

func (*GenerateTask) Name

func (c *GenerateTask) Name() string

func (*GenerateTask) OnExit

func (c *GenerateTask) OnExit() func()

func (*GenerateTask) Usage

func (c *GenerateTask) Usage() string

type Init

type Init struct{}

func (*Init) Action

func (c *Init) Action() func(flagValues map[string]interface{}) error

func (*Init) Args

func (c *Init) Args() []*CommandArg

func (*Init) Name

func (c *Init) Name() string

func (*Init) OnExit

func (c *Init) OnExit() func()

func (*Init) Usage

func (c *Init) Usage() string

type InitQueue

type InitQueue struct{}

func (*InitQueue) Action

func (c *InitQueue) Action() func(flagValues map[string]interface{}) error

func (*InitQueue) Args

func (c *InitQueue) Args() []*CommandArg

func (*InitQueue) Name

func (c *InitQueue) Name() string

func (*InitQueue) OnExit

func (c *InitQueue) OnExit() func()

func (*InitQueue) Usage

func (c *InitQueue) Usage() string

type MCPCommand added in v1.2.8

type MCPCommand struct{}

MCPCommand MCP 服务器命令

func (*MCPCommand) Action added in v1.2.8

func (c *MCPCommand) Action() func(flagValues map[string]interface{}) error

func (*MCPCommand) Args added in v1.2.8

func (c *MCPCommand) Args() []*CommandArg

func (*MCPCommand) Name added in v1.2.8

func (c *MCPCommand) Name() string

func (*MCPCommand) OnExit added in v1.2.8

func (c *MCPCommand) OnExit() func()

func (*MCPCommand) Usage added in v1.2.8

func (c *MCPCommand) Usage() string

Jump to

Keyboard shortcuts

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