http_gin

package
v0.0.0-...-bee5156 Latest Latest
Warning

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

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

Documentation

Index

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 GetServiceTypeMap(serviceName string, decls []ast.Decl) (res map[string]*ast.FuncDecl)

func Service2GinApi

func Service2GinApi(apiDir, serviceFilePath, implDir, serviceMountFilePath, testerFunc string)

func SyncItf2Svc

func SyncItf2Svc(recvTypeName, itfPkg string, fs *token.FileSet, file *ast.File, interfaceType *ast.InterfaceType) (res []byte)

func SyncTypeMap

func SyncTypeMap(recvName, itfPkg string, itfMap map[string]*ast.FuncType, funcMap map[string]*ast.FuncDecl) (appendStr []string)

func WriteApiFiles

func WriteApiFiles(path string, route *GinRoute) (err error)

func WriteTestFile

func WriteTestFile(fileName string, testcases ApiTestTemplate, overwriteTest bool) (err error)

Types

type ApiTestCase

type ApiTestCase struct {
	Router   string
	Method   string
	TestName string
	TestFunc string
	Return   string
	Param    string
	Title    string
	Jumper   string
}

type ApiTestTemplate

type ApiTestTemplate struct {
	Package       string
	TesterFactory string
	Tests         []ApiTestCase
}

type GinApi

type GinApi struct {
	HttpMethod string
	Route      string
	Handler    string
	Title      string
}

type GinRoute

type GinRoute struct {
	Package     string
	GroupName   string
	ServiceName string
	GroupRoute  string
	Apis        []GinApi
}

type Impl

type Impl struct {
	Service   string
	Interface string
}

Jump to

Keyboard shortcuts

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