Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var SName = "info" // shell客户端和服务端交互的unix套接字名称
Functions ¶
Types ¶
type Data ¶
type Data struct {
Name string `order:"1"`
Price float32 `order:"2"`
Stokes int `order:"3"`
Addition []interface{} `order:"4"`
Sth map[string]interface{} `order:"5"`
}
表格字段,如果需要显示表格,可以自行定义; order标签用于显示时的字段排序,若不设置order标签则按字段名排序;
type InfOptions ¶
type InfOptions struct {
All bool `alias:"a" required:"true" descr:"show all info or not"`
Info string `alias:"i" descr:"infomation"`
}
命令的具名参数(options)的配置;
必须继承*goktrl.KtrlOption;
结构体字段名即为参数名;
标签功能解释:
alias: 设置别名;
required: 是否为必传具名参数;
descr: 具名参数描述信息;
needparse: 一般不需要用户设置,已根据结构体字段类型进行自动处理;
支持的字段类型有: string, bool, int, uint, float
Click to show internal directories.
Click to hide internal directories.