console

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Command

type Command struct {
	*cobra.Command
}

Command 命令构建器

func CacheCommand

func CacheCommand() *Command

CacheCommand 缓存管理命令

func ConfigCommand

func ConfigCommand() *Command

ConfigCommand 配置管理命令

func MakeControllerCommand

func MakeControllerCommand(handler func(name string) error) *Command

MakeControllerCommand 创建控制器命令

func MakeMiddlewareCommand

func MakeMiddlewareCommand(handler func(name string) error) *Command

MakeMiddlewareCommand 创建中间件命令

func MakeMigrationCommand

func MakeMigrationCommand(handler func(name string) error) *Command

MakeMigrationCommand 创建迁移文件命令

func MakeModelCommand

func MakeModelCommand(handler func(name string) error) *Command

MakeModelCommand 创建模型命令

func MigrateCommand

func MigrateCommand(handler func(direction string) error) *Command

MigrateCommand 数据库迁移命令

func NewCommand

func NewCommand(use, short string, handler func(cmd *cobra.Command, args []string) error) *Command

NewCommand 创建新命令

func ServeCommand

func ServeCommand(handler func(addr string) error) *Command

ServeCommand 启动服务器命令

func (*Command) WithBoolFlag

func (c *Command) WithBoolFlag(name, shorthand string, value bool, usage string) *Command

WithBoolFlag 添加布尔标志

func (*Command) WithFlag

func (c *Command) WithFlag(name, shorthand, value, usage string) *Command

WithFlag 添加标志

func (*Command) WithIntFlag

func (c *Command) WithIntFlag(name, shorthand string, value int, usage string) *Command

WithIntFlag 添加整数标志

type Kernel

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

Kernel Artisan 命令内核

func New

func New(appName, version string) *Kernel

New 创建新的命令内核

func (*Kernel) Call

func (k *Kernel) Call(command string, args ...string) error

Call 编程方式调用命令

func (*Kernel) Register

func (k *Kernel) Register(cmd *cobra.Command)

Register 注册命令

func (*Kernel) RootCommand

func (k *Kernel) RootCommand() *cobra.Command

RootCommand 获取根命令

func (*Kernel) Run

func (k *Kernel) Run() error

Run 运行命令

Jump to

Keyboard shortcuts

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