Documentation ¶
Index ¶
- func GenApiTest(a ApiTestTemplate) (res []byte, err error)
- func GetGoModFilePath() (modPath string)
- func GetInterfaceTypeMap(itf *ast.InterfaceType) (res map[string]*ast.FuncType)
- func GetServiceTypeMap(serviceName string, decls []ast.Decl) (res map[string]*ast.FuncDecl)
- func Service2GinApi(apiDir, serviceFilePath, implDir, serviceMountFilePath, testerFunc string)
- func SyncItf2Svc(recvTypeName, itfPkg string, fs *token.FileSet, file *ast.File, ...) (res []byte)
- func SyncTypeMap(recvName, itfPkg string, itfMap map[string]*ast.FuncType, ...) (appendStr []string)
- func WriteApiFiles(path string, route *GinRoute) (err error)
- func WriteTestFile(fileName string, testcases ApiTestTemplate, overwriteTest bool) (err error)
- type ApiTestCase
- type ApiTestTemplate
- type GinApi
- type GinRoute
- type Impl
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenApiTest ¶
func GenApiTest(a ApiTestTemplate) (res []byte, err error)
func GetGoModFilePath ¶
func GetGoModFilePath() (modPath string)
func GetInterfaceTypeMap ¶
func GetInterfaceTypeMap(itf *ast.InterfaceType) (res map[string]*ast.FuncType)
func GetServiceTypeMap ¶
func Service2GinApi ¶
func Service2GinApi(apiDir, serviceFilePath, implDir, serviceMountFilePath, testerFunc string)
func SyncItf2Svc ¶
func SyncTypeMap ¶
func WriteApiFiles ¶
func WriteTestFile ¶
func WriteTestFile(fileName string, testcases ApiTestTemplate, overwriteTest bool) (err error)
Types ¶
type ApiTestCase ¶
type ApiTestTemplate ¶
type ApiTestTemplate struct { Package string TesterFactory string Tests []ApiTestCase }
Click to show internal directories.
Click to hide internal directories.