codegen

package
v1.3.7 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2022 License: MIT Imports: 37 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Create = os.Create
View Source
var MkdirAll = os.MkdirAll
View Source
var Open = os.Open
View Source
var Stat = os.Stat

Functions

func ExprStringP

func ExprStringP(expr ast.Expr) string

ExprStringP Support all built-in type referenced from https://golang.org/pkg/builtin/ Support map with string key Support structs of vo package Support slice of types mentioned above Not support alias type (all alias type fields of a struct will be outputted as v3.Any in openapi 3.0 json document) Support anonymous struct type as struct field type in vo package or as parameter type in method signature in svc.go file besides context.Context, multipart.FileHeader, v3.FileModel, os.File when go-doudou command line flag doc is true

func GenConfig

func GenConfig(dir string)

GenConfig generates config file

func GenDb

func GenDb(dir string)

GenDb generates db connection code

func GenDoc

func GenDoc(dir string, ic astutils.InterfaceCollector, routePatternStrategy int)

GenDoc generates OpenAPI 3.0 description json file. Not support alias type in vo file.

func GenGoClient

func GenGoClient(dir string, ic astutils.InterfaceCollector, env string, routePatternStrategy int, caseconvertor func(string) string)

GenGoClient generates golang http client code from result of parsing svc.go file in project root path

func GenGoClientProxy

func GenGoClientProxy(dir string, ic astutils.InterfaceCollector)

GenGoClientProxy wraps client with resiliency features

func GenGoIClient

func GenGoIClient(dir string, ic astutils.InterfaceCollector)

GenGoIClient generates golang http client interface code from result of parsing svc.go file in project root path

func GenGrpcProto added in v1.2.11

func GenGrpcProto(dir string, ic astutils.InterfaceCollector) (service v3.Service, protoFile string)

func GenHttpHandler

func GenHttpHandler(dir string, ic astutils.InterfaceCollector, routePatternStrategy int)

GenHttpHandler generates http handler interface and routes

func GenHttpHandlerImpl

func GenHttpHandlerImpl(dir string, ic astutils.InterfaceCollector, omitempty bool, caseconvertor func(string) string)

GenHttpHandlerImpl generates http handler implementation Parsed value from query string parameters or application/x-www-form-urlencoded form will be string type. You may need to convert the type by yourself.

func GenHttpIntegrationTesting added in v1.2.2

func GenHttpIntegrationTesting(dir string, ic astutils.InterfaceCollector, postmanCollectionPath, dotenvPath string)

func GenHttpMiddleware

func GenHttpMiddleware(dir string)

GenHttpMiddleware generates http middleware file

func GenK8sDeployment

func GenK8sDeployment(dir string, svcname, image string)

GenK8sDeployment generates deployment kind yaml file for kubernetes deploy.

func GenK8sStatefulset

func GenK8sStatefulset(dir string, svcname, image string)

GenK8sStatefulset generates statefulset kind yaml file for kubernetes deploy

func GenMain

func GenMain(dir string, ic astutils.InterfaceCollector)

GenMain generates main function

func GenMainGrpc added in v1.3.0

func GenMainGrpc(dir string, ic astutils.InterfaceCollector, grpcSvc v3.Service)

GenMainGrpc generates main function for grpc service

func GenSvcImpl

func GenSvcImpl(dir string, ic astutils.InterfaceCollector)

GenSvcImpl generates service implementation

func GenSvcImplGrpc added in v1.3.0

func GenSvcImplGrpc(dir string, ic astutils.InterfaceCollector, grpcSvc v3.Service)

GenSvcImplGrpc generates service implementation for grpc

func InitProj

func InitProj(dir string, modName string, runner executils.Runner)

InitProj inits a service project dir is root path modName is module name

func InitSvc

func InitSvc(dir string)

InitSvc inits a service project, test purpose only

func ParseVo added in v1.0.5

func ParseVo(dir string)

func ParseVoGrpc added in v1.2.11

func ParseVoGrpc(dir string)

Types

This section is empty.

Jump to

Keyboard shortcuts

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