Documentation ¶
Index ¶
Constants ¶
View Source
const ControllerStr = "controller"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type API ¶
type API struct { Name string Desc string Method string URL string TargetFile string Request *Message Response *Message }
API represents a rpc definition in a proto file, corresponding to a gin controller.
type Controller ¶
type Controller struct { Module string PackageName string // 包名 PbPath string // pb文件路径 PbAlias string // pb别名 Func ControllerFunc }
type ControllerFunc ¶
type Field ¶
Field represents a field definition in a proto message. We only need its inline comment to modify go tags so we don't parse the comment.
type Generator ¶ added in v1.1.14
type Generator struct { GoModule string ProtoPath string ProtoFiles []string PbPath string PbAlias string PbFiles []string ControllerPath string RouterFile string ThirdPartyPath string SdkPath string SwaggerPath string ServiceNodeMap map[string]string }
Generator is responsible to init project and generates codes from proto.
var (
Gener *Generator
)
func NewGenerator ¶
New returns a new instance of Generator.
type Message ¶
type Message struct { Name string // File is the proto file where it's defined. File string Fields []*Field }
Message represents a message definition in a proto file.
type Project ¶
func (*Project) GenerateTemplateFile ¶
Click to show internal directories.
Click to hide internal directories.