Documentation ¶
Index ¶
- Variables
- func ExprStringP(expr ast.Expr) string
- func FixModGrpc(dir string)
- func GenConfig(dir string)
- func GenDb(dir string)
- func GenDoc(dir string, ic astutils.InterfaceCollector, config GenDocConfig)
- func GenGoClient(dir string, ic astutils.InterfaceCollector, config GenGoClientConfig)
- func GenGoClientProxy(dir string, ic astutils.InterfaceCollector)
- func GenGoIClient(dir string, ic astutils.InterfaceCollector)
- func GenGrpcProto(dir string, ic astutils.InterfaceCollector, p v3.ProtoGenerator) (service v3.Service, protoFile string)
- func GenHttpHandler(dir string, ic astutils.InterfaceCollector, routePatternStrategy int)
- func GenHttpHandlerImpl(dir string, ic astutils.InterfaceCollector, config GenHttpHandlerImplConfig)
- func GenHttpIntegrationTesting(dir string, ic astutils.InterfaceCollector, ...)
- func GenHttpMiddleware(dir string)
- func GenK8sDeployment(dir string, svcname, image string)
- func GenK8sStatefulset(dir string, svcname, image string)
- func GenMain(dir string, ic astutils.InterfaceCollector)
- func GenMainGrpc(dir string, ic astutils.InterfaceCollector, grpcSvc v3.Service)
- func GenMethodAnnotationStore(dir string, ic astutils.InterfaceCollector)
- func GenSvcImpl(dir string, ic astutils.InterfaceCollector)
- func GenSvcImplGrpc(dir string, ic astutils.InterfaceCollector, grpcSvc v3.Service)
- func InitProj(dir string, modName string, runner executils.Runner, genSvcGo bool)
- func InitSvc(dir string)
- func ParseDto(dir string, dtoDir string)
- func ParseDtoGrpc(dir string, p v3.ProtoGenerator, dtoDir string)
- type GenDocConfig
- type GenGoClientConfig
- type GenHttpHandlerImplConfig
Constants ¶
This section is empty.
Variables ¶
var Create = os.Create
var MkdirAll = os.MkdirAll
var Open = os.Open
var Stat = os.Stat
Functions ¶
func ExprStringP ¶
ExprStringP Support all built-in type referenced from https://golang.org/pkg/builtin/ Support map with string key Support structs of vo and dto 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 and dto 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 GenDoc ¶
func GenDoc(dir string, ic astutils.InterfaceCollector, config GenDocConfig)
GenDoc generates OpenAPI 3.0 description json file. Not support alias type in vo or dto file.
func GenGoClient ¶
func GenGoClient(dir string, ic astutils.InterfaceCollector, config GenGoClientConfig)
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 ¶
func GenGrpcProto(dir string, ic astutils.InterfaceCollector, p v3.ProtoGenerator) (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, config GenHttpHandlerImplConfig)
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 ¶
func GenHttpIntegrationTesting(dir string, ic astutils.InterfaceCollector, postmanCollectionPath, dotenvPath string)
func GenHttpMiddleware ¶
func GenHttpMiddleware(dir string)
GenHttpMiddleware generates http middleware file
func GenK8sDeployment ¶
GenK8sDeployment generates deployment kind yaml file for kubernetes deploy.
func GenK8sStatefulset ¶
GenK8sStatefulset generates statefulset kind yaml file for kubernetes deploy
func GenMain ¶
func GenMain(dir string, ic astutils.InterfaceCollector)
GenMain generates main function
func GenMainGrpc ¶
func GenMainGrpc(dir string, ic astutils.InterfaceCollector, grpcSvc v3.Service)
GenMainGrpc generates main function for grpc service
func GenMethodAnnotationStore ¶
func GenMethodAnnotationStore(dir string, ic astutils.InterfaceCollector)
func GenSvcImpl ¶
func GenSvcImpl(dir string, ic astutils.InterfaceCollector)
GenSvcImpl generates service implementation
func GenSvcImplGrpc ¶
func GenSvcImplGrpc(dir string, ic astutils.InterfaceCollector, grpcSvc v3.Service)
GenSvcImplGrpc generates service implementation for grpc
func ParseDtoGrpc ¶ added in v2.0.4
func ParseDtoGrpc(dir string, p v3.ProtoGenerator, dtoDir string)