Documentation ¶
Overview ¶
You can use the "packr clean" command to clean up this, and any other packr generated files.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseProtos ¶ added in v1.1.14
Types ¶
type API ¶
type API struct { Name string Desc string Method string URL string // Target file is the go file where it should be generated. 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 {
// contains filtered or unexported fields
}
Generator is responsible to init project and generates codes from proto.
func NewGenerator ¶
New returns a new instance of Generator.
func (*Generator) GenController ¶ added in v1.1.14
生成controller
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.