Documentation ¶
Index ¶
- func FunctionJointForOpenAPI(service string, functionPart []FunctionPart) string
- func GetImportPkgName(root, module, path string) string
- func GetModule(root string) (string, error)
- func ProduceBaseFile(path, pkg, service string, pkgImports []template.HTML) error
- func ProducePath(root string, client ClientInfo, service string) string
- func WriteFuncs(path, funcs string) error
- type ClientInfo
- type FunctionPart
- type Template
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FunctionJointForOpenAPI ¶
func FunctionJointForOpenAPI(service string, functionPart []FunctionPart) string
FunctionJointForOpenAPI joint function part to a complete function special for api test.
func GetImportPkgName ¶
GetImportPkgName get the idl generated client package which will import to http client file.
func ProduceBaseFile ¶
ProduceBaseFile generate client of specific service @param path string "path of generated file" @param pkg string "package name of go file" @param service string "service name" @param pkgImports []string "imported package list"
func ProducePath ¶
func ProducePath(root string, client ClientInfo, service string) string
ProducePath returns the full path of generated file
func WriteFuncs ¶
WriteFuncs write generated http function to give file.
Types ¶
type ClientInfo ¶
type ClientInfo struct { Group string // group which client belongs to Path string // path which client.go will be generated }
ClientInfo consist of group info and path to client.go
func GetClientInfo ¶
func GetClientInfo(root string) []ClientInfo
GetClientInfo return idl generated client.go path, and get which group this client belongs to.
type FunctionPart ¶
type FunctionPart struct { Action string Request string Response string NewResponse string // struct name without pointer, used to create a new blank return struct. }
FunctionPart consist of essential part to generate http api function.
func GetFuncPart ¶
GetFuncPart get the service, Action, Request, Response and Response struct from idl generated function.