templates

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: May 8, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const PingTxt = `` /* 6400-byte string literal not displayed */

Variables

View Source
var (
	BffMakefileTemplate  = template.Must(template.New("").Parse(makeFileTxt))
	BffErrCodeTemplate   = template.Must(template.New("").Parse(errCodeTxt))
	BffConfigYmlTemplate = template.Must(template.New("").Parse(bffConfigYmlTxt))
	BffConfigTemplate    = template.Must(template.New("").Parse(bffConfigTxt))
	BffImplTemplate      = template.Must(template.New("").Parse(bffImplTxt))
	BffRouterTemplate    = template.Must(template.New("").Parse(bffRouterTxt))
	BffHookTemplate      = template.Must(template.New("").Parse(bffHookTxt))
	BffMainTemplate      = template.Must(template.New("").Parse(bffMainTxt))
)
View Source
var (
	JobMakefileTemplate = template.Must(template.New("").Parse(makeFileTxt))
	JobMainTpl          = template.Must(template.New("").Parse(jobMainTxt))
	JobScheduleTpl      = template.Must(template.New("").Parse(jobScheduleTxt))
	JobCmdRootTpl       = template.Must(template.New("").Parse(jobCmdTxt))
	JobCmdSubTpl        = template.Must(template.New("").Parse(jobCmdSubTxt))
)
View Source
var (
	ServiceConfigYmlTpl  = template.Must(template.New("").Parse(serviceConfigYmlTxt))
	ServiceConfigTpl     = template.Must(template.New("").Parse(serviceConfigTxt))
	ServiceHookTpl       = template.Must(template.New("").Parse(serviceHookTxt))
	ServiceServerTpl     = template.Must(template.New("").Parse(serviceServerTxt))
	ServiceServerInitTpl = template.Must(template.New("").Parse(serviceServerInitTxt))
	ServiceMainTpl       = template.Must(template.New("").Parse(serviceMainTxt))
	ServiceImplTpl       = template.Must(template.New("").Parse(serviceImplTxt))
)
View Source
var ApiListMarkdownTemplate = template.Must(template.New("").Parse(apiListMarkdownTxt))
View Source
var IntellijAutomatedTemplate = template.Must(template.New("").Parse(intellijAutomatedTestTxt))
View Source
var InterfaceMarkdownTemplate = template.Must(template.New("").Parse(interfaceMarkdownTxt))
View Source
var ORMTemplate = template.Must(template.New("").Funcs(template.FuncMap{"SqlColumn": SqlColumn}).Parse(ormTxt))

Functions

func ParseTemplate

func ParseTemplate(tpl *template.Template, data interface{}) (string, error)

func SqlColumn

func SqlColumn(list []ORMProperty) string

Types

type ApiListProperty

type ApiListProperty struct {
	Title string
	List  []ApiListTable
}

type ApiListTable

type ApiListTable struct {
	Title string
	List  []*ApiTable
}

type ApiTable

type ApiTable struct {
	Link    string
	Remarks string
	Emoji   string
}

type BffHookTplArg

type BffHookTplArg struct {
	Alias         string
	ImportPackage string
}

type BffImplTplArg

type BffImplTplArg struct {
	PackageName   string
	RPCPath       string
	InterfaceName string
	TagZh         string
	TagLogin      string
	TagPage       string
	TagURI        string
}

type BffMainTplArg

type BffMainTplArg struct {
	HookImport   string
	RouterImport string
}

type BffRouterImplTplArg

type BffRouterImplTplArg struct {
	ImplsImport        string
	GroupRouter        string
	CamelInterfaceName string
	InterfaceName      string
}

type IntellijAutomatedProperty

type IntellijAutomatedProperty struct {
	Title string
	URL   string
	Data  string
}

type JobCmdSubTplArg added in v0.1.1

type JobCmdSubTplArg struct {
	ImportPacket string
	CobraUse     string
	CmdName      string
	Schedule     string
}

type JobMainTplArg added in v0.1.1

type JobMainTplArg struct {
	ImportPackage string
}

type MarkdownErrCodeTable

type MarkdownErrCodeTable struct {
	Name    string // 名称
	Value   int    // 值
	Desc    string // 描述
	Remarks string // 备注
}

type MarkdownProperty

type MarkdownProperty struct {
	Login              string
	Page               []string
	Zh                 string
	URI                string
	RequestTable       []MarkdownTable
	RequestJson        interface{} // 请求参数示例
	RequestTypeScript  interface{} // 请求参数-typescript 对象映射
	RequestJava        interface{} // 请求参数-Java 对象映射
	RequestSwift       interface{} // 请求参数-Swift 对象映射
	RequestCurl        interface{} // 请求curl
	ResponseTable      []MarkdownTable
	ResponseJson       interface{} // 应答参数示例
	ResponseTypeScript interface{} // 应答参数-typescript 对象映射
	ResponseJava       interface{} // 应答参数-Java 对象映射
	ResponseSwift      interface{} // 应答参数-Swift 对象映射
	ErrCodeTable       []MarkdownErrCodeTable
}

type MarkdownReqRespTable

type MarkdownReqRespTable struct {
	FieldName   string      // 参数名称
	FieldType   string      // 类型
	FieldDesc   string      // 参数含义
	FieldIgnore string      // 必填
	DefValue    interface{} // 默认值
	FieldRemark interface{} // 备注
	FieldValue  interface{} // 值(根据不同的类型生成的值不一样)
}

type MarkdownTable

type MarkdownTable struct {
	Title  string
	Tables []MarkdownReqRespTable
}

type ORMProperty

type ORMProperty struct {
	Name string
	Type string
}

type ORMTplArg

type ORMTplArg struct {
	ShortTable    string
	FullTable     string
	TableName     string
	SnakeProperty []ORMProperty
	CamelProperty []ORMProperty
}

type ServiceHookTplArg

type ServiceHookTplArg struct {
	Alias         string
	ImportPackage string
}

type ServiceImplArg

type ServiceImplArg struct {
	ImportPackage string
	AliasName     string
	ServerName    string
	ImplName      string
	RequestName   string
	ResponseName  string
}

type ServiceMainTplArg

type ServiceMainTplArg struct {
	List        []string
	SystemName  string
	ServiceName string
}

type ServiceServerTplArg

type ServiceServerTplArg struct {
	ImportPackage   string
	AliasName       string
	SystemShortName string // eg: demo
	ServerName      string
}

Jump to

Keyboard shortcuts

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