Documentation ¶
Index ¶
- type Enum
- type EnumValue
- type Extension
- type Field
- type File
- func (po *File) FullName() string
- func (pf *File) GetEnum(name string) *Enum
- func (pf *File) GetMessage(name string) *Message
- func (pf *File) GetService(name string) *Service
- func (pf *File) HasEnum(name string) bool
- func (pf *File) HasMessage(name string) bool
- func (pf *File) HasService(name string) bool
- type Message
- type ParseResult
- type Service
- type ServiceMethod
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Enum ¶
type Enum struct { Values []*EnumValue // contains filtered or unexported fields }
An Enum object to encapsulate enum details.
type EnumValue ¶
type EnumValue struct { Number int32 // contains filtered or unexported fields }
An EnumValue object to encapsulate enum value details.
type Field ¶
type Field struct { Type string Label string DefaultValue string // contains filtered or unexported fields }
A Field object to encapsulate message field details.
type File ¶
type File struct { Enums []*Enum Extensions []*Extension Messages []*Message Services []*Service // contains filtered or unexported fields }
File represents a parsed file object. All information about a proto file will be encapsulated in a File object.
func (*File) GetEnum ¶
GetEnum finds an enum object by name and returns it. It will return `nil` if not found.
func (*File) GetMessage ¶
GetMessage finds a message by name and returns it. It will return `nil` if not found.
func (*File) GetService ¶
GetService finds a service by name and returns it. It will return `nil` if not found.
func (*File) HasMessage ¶
HasMessage indicated whether or not this file contains the named message.
func (*File) HasService ¶
HasService indicated whether or not this file contains the named service.
type Message ¶
type Message struct { Extensions []*Extension Fields []*Field // contains filtered or unexported fields }
A Message object to encapsulate message details.
type ParseResult ¶
type ParseResult struct {
Files []*File
}
A ParseResult contains a set of parsed proto files
func ParseCodeRequest ¶
func ParseCodeRequest(req *plugin_go.CodeGeneratorRequest) *ParseResult
ParseCodeRequest iterates through all the proto files in the code gen request, parses them, and finally adds them to the returned ParseResult
func (*ParseResult) GetFile ¶
func (pr *ParseResult) GetFile(name string) *File
GetFile returns the parsed proto file specified by the name (base name without path) e.g. pr.GetFile("Vehicle.proto")
type Service ¶
type Service struct { Methods []*ServiceMethod // contains filtered or unexported fields }
A Service object to encasulate service details.