tplgo

package
v1.0.0-...-68e451e Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2018 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Gen

func Gen(limit, threads int, pkg, tag, base, out string, grayscale bool) error

func MakeTplData

func MakeTplData(data *TplData) ([]byte, error)

Types

type Method

type Method struct {
	Src      string       // sql 源文件代码
	Line     string       // 第几行
	Name     string       // 定义的函数名
	Slice    string       // 类型前缀
	Type     string       // 操作类型
	Comm     string       // 注释
	Req      []*Parameter // 请求的参数
	ReqCount []*Parameter // 如果是获取count 请求的参数
	Resp     []*Parameter // 返回的参数
	Count    bool         // 是获取 count
	DDL      bool         // 是 DDL
}

func ParseMethods

func ParseMethods(t []*template.Template) ([]*Method, error)

type Parameter

type Parameter struct {
	Name string // 名字
	Type string // 类型
	Tags string // 标签
	Comm string // 注释
}

func NewParameter

func NewParameter(v []string) *Parameter

type TplData

type TplData struct {
	Gray      bool      // 启用灰度更新
	Pkg       string    // 包名
	By        string    // gen 注释
	MaxLimit  int       // 最大读取行数限制
	MaxFork   int       // 读取最大线程限制
	Path      string    // sql文件引用路径
	FieldName string    // 标签名
	Methods   []*Method // 方法
}

Jump to

Keyboard shortcuts

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