internal_genhi

package
v0.0.0-...-a09b0a9 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

SupportedFeatures reports the set of supported protobuf language features.

Functions

func ApiGroup

func ApiGroup(srv *protogen.Service) string

func Exec

func Exec(ts *TsTemplate)

Exec 执行生成代码

func GenFuncDesc

func GenFuncDesc(method *protogen.Method) string

GenFuncDesc 获取rpc每个接口的描述

func GenerateFile

func GenerateFile(gen *protogen.Plugin, file *protogen.File) *protogen.GeneratedFile

GenerateFile generates the contents of a .pb.go file.

func GetMethodPath

func GetMethodPath(group string, m *protogen.Method) (path, method string)

func ToJsNumber

func ToJsNumber(k protoreflect.Kind) string

Types

type Comment

type Comment struct {
	// FuncComment 函数功能描述
	FuncComment string       `json:"func_comment"`
	Params      []*ParamDesc `json:"params"`
	Response    []*ParamDesc `json:"response"`
}

type FuncDesc

type FuncDesc struct {
	FuncName string   `json:"func_name"`
	Method   string   `json:"method"`
	Path     string   `json:"path"`
	Comment  *Comment `json:"comment"`
}

type IFace

type IFace struct {
	// contains filtered or unexported fields
}

type ParamDesc

type ParamDesc struct {
	Typ  string `json:"typ"`
	Key  string `json:"key"`
	Desc string `json:"desc"`
}

func GetInput

func GetInput(input *protogen.Message) []*ParamDesc

GetInput 获取请求参数的字段详细信息

type RestfulAPI

type RestfulAPI struct {
	// 请求方法。 目前支持GET,POST,ANY
	RequestMethod string
	// 自定义的路径
	Url string
	// api方法
	Method string
	// contains filtered or unexported fields
}

RestfulAPI 定义方法

type ServiceInfo

type ServiceInfo struct {
	// 根路由
	ProjectUri string
	// 中间件
	MiddleWire string
	// 导包路径
	ImportPath []string
	Method     string
}

ServiceInfo 服务的基本信息,包括组路由,中间件

type TsTemplate

type TsTemplate struct {
	FD      []*FuncDesc `json:"fd"`
	FilName string      `json:"filName"`
}

Jump to

Keyboard shortcuts

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