parser

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2017 License: MIT Imports: 6 Imported by: 0

Documentation

Index

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.

func (*Enum) FullName

func (po *Enum) FullName() string

type EnumValue

type EnumValue struct {
	Number int32
	// contains filtered or unexported fields
}

An EnumValue object to encapsulate enum value details.

func (*EnumValue) FullName

func (po *EnumValue) FullName() string

type Extension

type Extension struct {
	Field
	Label          string
	Number         int32
	ContainingType string
	ScopeType      string
}

An Extension object to encapsulate extension details.

func (*Extension) FullName

func (ext *Extension) FullName() string

FullName returns the full name of this extension including the containing type

type Field

type Field struct {
	Type         string
	Label        string
	DefaultValue string
	// contains filtered or unexported fields
}

A Field object to encapsulate message field details.

func (*Field) FullName

func (po *Field) FullName() string

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) FullName

func (po *File) FullName() string

func (*File) GetEnum

func (pf *File) GetEnum(name string) *Enum

GetEnum finds an enum object by name and returns it. It will return `nil` if not found.

func (*File) GetMessage

func (pf *File) GetMessage(name string) *Message

GetMessage finds a message by name and returns it. It will return `nil` if not found.

func (*File) GetService

func (pf *File) GetService(name string) *Service

GetService finds a service by name and returns it. It will return `nil` if not found.

func (*File) HasEnum

func (pf *File) HasEnum(name string) bool

HasEnum indicated whether or not a file-level enum exists.

func (*File) HasMessage

func (pf *File) HasMessage(name string) bool

HasMessage indicated whether or not this file contains the named message.

func (*File) HasService

func (pf *File) HasService(name string) bool

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.

func (*Message) FullName

func (po *Message) FullName() string

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.

func (*Service) FullName

func (po *Service) FullName() string

type ServiceMethod

type ServiceMethod struct {
	ClientStreaming bool
	ServerStreaming bool
	RequestType     string
	ResponseType    string
	// contains filtered or unexported fields
}

A ServiceMethod object to encapsulate service method details.

func (*ServiceMethod) FullName

func (po *ServiceMethod) FullName() string

Jump to

Keyboard shortcuts

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