command

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: May 15, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Base added in v1.0.3

type Base struct {
	// 名称
	Name string
	// 别名
	Aliases []string
	// 使用方法
	Usage string
}

Base 命令基类

func (*Base) GetAliases added in v1.0.3

func (c *Base) GetAliases() []string

func (*Base) GetName added in v1.0.3

func (c *Base) GetName() string

func (*Base) GetUsage added in v1.0.3

func (c *Base) GetUsage() string

func (*Base) SubCommands added in v1.0.3

func (c *Base) SubCommands() (commands []app.Command)

type Migrate added in v1.0.10

type Migrate struct {
	Base
	// contains filtered or unexported fields
}

Migrate 描述一个提供服务的命令

func NewMigrate added in v1.0.10

func NewMigrate(logger *glog.ZapLogger) *Migrate

NewMigrate 创建服务命令

func (*Migrate) Run added in v1.0.10

func (m *Migrate) Run(_ *app.Context) error

func (*Migrate) SetMigration added in v1.0.10

func (m *Migrate) SetMigration(migration migration)

type Serve

type Serve struct {
	Base
	// contains filtered or unexported fields
}

Serve 描述一个提供服务的命令

func NewServe

func NewServe(logger *glog.ZapLogger) *Serve

NewServe 创建服务命令

func (*Serve) Adds added in v1.0.1

func (s *Serve) Adds(serves ...serve)

func (*Serve) Run

func (s *Serve) Run(ctx *app.Context) (err error)

func (*Serve) SetMigration added in v1.0.10

func (s *Serve) SetMigration(migration migration)

type Version

type Version struct {
	Base
	// contains filtered or unexported fields
}

Version 描述一个打印版本信息的命令

func NewVersion

func NewVersion(
	appName info.AppName, appVersion info.AppVersion,
	buildVersion info.BuildVersion, buildTime info.BuildTime,
	scmRevision info.ScmRevision, scmBranch info.ScmBranch,
	goVersion info.GoVersion,
) *Version

NewVersion 创建版本信息命令

func (*Version) Run

func (v *Version) Run(_ *app.Context) (err error)

Jump to

Keyboard shortcuts

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