util

package
v0.0.0-...-14c9cf9 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2020 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateMd

func CreateMd(sysDir string, bffName string, impls []string) error

func StdoutExit

func StdoutExit(exitCode int, format string, args ...interface{})

func String

func String(xt XType) string

func SystemBaseDir

func SystemBaseDir() (sysDir string, systemName string, err error)

func ValueIg

func ValueIg(xt XType) interface{}

Types

type MarkdownProperty

type MarkdownProperty struct {
	Login         string
	Page          []string
	Zh            string
	URI           string
	RequestTable  []MarkdownTable
	RequestJson   interface{} // 请求参数示例
	ResponseTable []MarkdownTable
	ResponseJson  interface{} // 应答参数示例
}

type MarkdownTable

type MarkdownTable struct {
	Title   string
	Columns []MarkdownTableColumn
}

type MarkdownTableColumn

type MarkdownTableColumn struct {
	FieldName   string      // 参数名称
	FieldType   string      // 类型
	FieldDesc   string      // 参数含义
	FieldIgnore string      // 必填
	DefValue    interface{} // 默认值
	FieldRemark interface{} // 备注
}

type XArray

type XArray struct {
	EleType XType
}

type XBase

type XBase struct {
	BName string
}

buildin type (exclude map slice array etc.) or user define struct type

func (*XBase) IsBasic

func (x *XBase) IsBasic() bool

type XField

type XField struct {
	FName   string
	Type    XType
	Comment XFieldComment
}

type XFieldComment

type XFieldComment struct {
	Desc     string
	Required string
	DefaultV string
	Remark   string
}

type XInterfaceNode

type XInterfaceNode struct {
	ZhName   string
	Login    string
	Uri      string
	Page     string
	Desc     string
	Request  *XTypeSpec
	Response *XTypeSpec
}

func (*XInterfaceNode) ToMarkDown

func (in *XInterfaceNode) ToMarkDown() *MarkdownProperty

type XMap

type XMap struct {
	Key   XType
	Value XType
}

type XPoint

type XPoint struct {
	X XType
}

type XStruct

type XStruct struct {
	Fields []*XField
}

func (*XStruct) ToMap

func (xs *XStruct) ToMap() map[string]interface{}

func (*XStruct) ToMarkdownTable

func (xs *XStruct) ToMarkdownTable() []MarkdownTableColumn

type XType

type XType interface {
}

type XTypeSpec

type XTypeSpec struct {
	TName string
	Type  XType
}

func (*XTypeSpec) ToMap

func (xSpec *XTypeSpec) ToMap() map[string]interface{}

func (*XTypeSpec) ToMarkdownTable

func (xSpec *XTypeSpec) ToMarkdownTable() (MarkdownTable, bool)

Jump to

Keyboard shortcuts

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