proto

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2020 License: GPL-3.0 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 {
	Name        string
	ParentName  string
	Options     Options
	Fields      Fields
	IsEmbedded  bool
	FromShared  bool
	FromPackage string
}

func (*Enum) PublicName

func (e *Enum) PublicName() string

type ErrNode

type ErrNode struct {
	Line   int
	Column int
	Text   string
}

type ErrorListener

type ErrorListener struct {
	*antlr.DefaultErrorListener
	Listener *ProtoListener
}

func (*ErrorListener) SyntaxError

func (uel *ErrorListener) SyntaxError(rec antlr.Recognizer, offend interface{}, line int, column int, msg string, e antlr.RecognitionException)

type Field

type Field struct {
	Name        string
	Kind        string
	MapKind     KeyValue
	Pos         string
	Options     Options
	OneOf       Fields
	IsEnumField bool // belongs to enum fields
	IsRepeated  bool
	IsMap       bool
	IsOneOf     bool
	IsReserved  bool
	FromShared  bool
	FromPackage string
}

func (*Field) GoKind

func (f *Field) GoKind() string

func (*Field) IsBasic

func (f *Field) IsBasic() bool

func (*Field) IsTimestamp

func (f *Field) IsTimestamp() bool

func (*Field) PublicName

func (f *Field) PublicName() string

func (*Field) ZeroValue

func (f *Field) ZeroValue() string

type Fields

type Fields []Field

func (Fields) FirstPublicName

func (coll Fields) FirstPublicName() string

type KeyValue

type KeyValue struct {
	Key   string
	Value string
}

type Message

type Message struct {
	Name        string
	Fields      Fields
	Options     Options
	Enums       []Enum
	Messages    []Message // nested messages
	IsNested    bool
	FromShared  bool
	FromPackage string
}

type Method

type Method struct {
	Name              string
	InKind            string
	OutKind           string
	Options           Options
	IsServerStreaming bool
	IsClientStreaming bool
}

func (*Method) GetHTTPRoute

func (m *Method) GetHTTPRoute() string

func (*Method) GetHTTPVerb

func (m *Method) GetHTTPVerb() string

func (*Method) NoStreaming

func (m *Method) NoStreaming() bool

type Option

type Option struct {
	Name       string
	Value      string
	Values     []KeyValue
	IsConstant bool
}

type Options

type Options []Option

func (Options) HasOneNamed

func (o Options) HasOneNamed(name string) bool

func (Options) NamedValue

func (o Options) NamedValue(name string) string

func (Options) NamedValueEq

func (o Options) NamedValueEq(name, value string) bool

type Proto

type Proto struct {
	Name        string
	Syntax      string
	PackageName string
	Options     Options
	Imports     []string
	Messages    []Message
	Services    Services
	Enums       []Enum
	Error       *ErrNode
	EnumsMap    map[string]string
	IsShared    bool
}

type ProtoListener

type ProtoListener struct {
	*parser.BaseantlrListener
	Proto Proto
}

func (*ProtoListener) ExitProto

func (s *ProtoListener) ExitProto(ctx *parser.ProtoContext)

type Service

type Service struct {
	Name        string
	Methods     []Method
	Options     Options
	FromShared  bool
	FromPackage string
}

type Services

type Services []Service

func (Services) AnyOptionNamedValueEq

func (s Services) AnyOptionNamedValueEq(name, value string) bool

func (Services) HasOptionNamed

func (s Services) HasOptionNamed(name string) bool

Jump to

Keyboard shortcuts

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