Commands

package
v0.0.0-...-1a1764e Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Commands map[string]ICommand //用于保存所有命令

Functions

func Parse

func Parse()

Types

type CommandSet

type CommandSet struct{} //用户操作Commands集合的 类

func NewCommandSet

func NewCommandSet() *CommandSet

func (*CommandSet) Each

func (this *CommandSet) Each(fn func(item ICommand))

func (*CommandSet) Register

func (this *CommandSet) Register(name string, cmd ICommand)

type ConfigCmd

type ConfigCmd struct {
	FlagValue *bool
	CommandSet
	ServiceCommandSet *flag.FlagSet
}

func NewConfigCmd

func NewConfigCmd() *ConfigCmd

func (*ConfigCmd) Init

func (this *ConfigCmd) Init()

func (*ConfigCmd) Run

func (this *ConfigCmd) Run()

type DBCommand

type DBCommand struct {
	//用来处理静态资源的生成
	DSN       *string
	TableName *string
	IsCreate  *bool
	CommandSet
	ServiceCommandSet *flag.FlagSet
}

func NewDBCmd

func NewDBCmd() *DBCommand

func (*DBCommand) Init

func (this *DBCommand) Init()

func (*DBCommand) Run

func (this *DBCommand) Run()

type ICommand

type ICommand interface {
	Init()
	Run()
}

type ResourceCommand

type ResourceCommand struct {
	IsCreate *bool
	ResPath  *string
	CommandSet
	ServiceCommandSet *flag.FlagSet //这里做了改动。直接在属性中
}

func NewResourceCmd

func NewResourceCmd() *ResourceCommand

func (*ResourceCommand) Init

func (this *ResourceCommand) Init()

func (*ResourceCommand) Run

func (this *ResourceCommand) Run()

type VersionCmd

type VersionCmd struct {
	FlagValue *bool
	CommandSet
}

func NewVersionCmd

func NewVersionCmd() *VersionCmd

func (*VersionCmd) Init

func (this *VersionCmd) Init()

func (*VersionCmd) Run

func (this *VersionCmd) Run()

Jump to

Keyboard shortcuts

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