Documentation ¶
Index ¶
- Variables
- func AddCommand(cmds ...*Command) *application
- func App() *application
- func New(name, version string) *application
- func Run()
- func SetDebug(debug bool) *application
- func SetName(name string) *application
- func SetVersion(version string) *application
- func Use(h ...HandlerFunc) *application
- type Command
- type HandlerFunc
- type NotFoundError
- type Option
- type RunI
- type UnsupportedError
Constants ¶
This section is empty.
Variables ¶
View Source
var (
// Version
Version = "1.0.0"
)
Functions ¶
Types ¶
type Command ¶
type Command struct { // 命令名称 Name string // 简短描述 Short string // 详细描述 Long string // 使用范例 // 子命令:"Usage: %s %s [ARG...]" // 单命令:"Usage: %s [ARG...]" UsageF string // 选项 Options []*Option // 执行 RunF func() RunI RunI // 是否单命令 Singleton bool // 是否为默认命令 Default bool // contains filtered or unexported fields }
Command
type NotFoundError ¶
type NotFoundError struct {
// contains filtered or unexported fields
}
NotFoundError 未找到错误
type UnsupportedError ¶
type UnsupportedError struct {
// contains filtered or unexported fields
}
UnsupportedError 不支持错误
func NewUnsupportedError ¶
func NewUnsupportedError(err error) *UnsupportedError
NewUnsupportedError 创建不支持错误
Click to show internal directories.
Click to hide internal directories.