dispatch

package
v1.3.8 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultSock   = "info"
	Sock1         = "info1"
	IsServerSock1 = false
)

Functions

func Handler

func Handler(c *goktrl.Context)

func Info

func Info(c *goktrl.Context)

func RunC

func RunC()

func RunS

func RunS(sockName string)

func ShowTable

func ShowTable(sockName string) *goktrl.Ktrl

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

Jump to

Keyboard shortcuts

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