parser

package
v0.0.0-...-3d7851a Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2018 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 {
	Name          string
	QuotedComment string
	Values        []*EnumValue
	Type          *Type

	TypeName   TypeName
	Descriptor *proto.Enum
	// contains filtered or unexported fields
}

type EnumValue

type EnumValue struct {
	Name          string
	Value         int
	QuotedComment string
}

type Field

type Field struct {
	Name          string
	QuotedComment string
	Repeated      bool

	Type *Type
	// contains filtered or unexported fields
}

type File

type File struct {
	FilePath string

	PkgName  string
	Services []*Service
	Messages []*Message
	Enums    []*Enum
	Imports  []*File
	// contains filtered or unexported fields
}

type Map

type Map struct {
	Type      *Type
	Message   *Message
	KeyType   *Type
	ValueType *Type
	Field     *proto.MapField
	File      *File
}

type MapField

type MapField struct {
	Name          string
	QuotedComment string

	Type *Type
	Map  *Map
	// contains filtered or unexported fields
}

type Message

type Message struct {
	Name          string
	QuotedComment string
	Fields        []*Field
	MapFields     []*MapField
	OneOffs       []*OneOf
	Type          *Type
	Descriptor    *proto.Message
	TypeName      TypeName
	// contains filtered or unexported fields
}

func (Message) HaveFields

func (m Message) HaveFields() bool

func (Message) HaveFieldsExcept

func (m Message) HaveFieldsExcept(field string) bool

type Messages

type Messages []*Message

func (Messages) Contains

func (m Messages) Contains(msg *Message) bool

func (Messages) Copy

func (m Messages) Copy() Messages

type Method

type Method struct {
	Name          string
	QuotedComment string
	InputMessage  *Message
	OutputMessage *Message
	Service       *Service
}

type OneOf

type OneOf struct {
	Name   string
	Fields []*Field
}

type Parser

type Parser struct {
	ImportAliases map[string]string
	Paths         []string
	// contains filtered or unexported fields
}

func New

func New(importsAliases map[string]string, paths []string) *Parser

func (*Parser) Parse

func (p *Parser) Parse(path string) (*File, error)

type Service

type Service struct {
	Name          string
	QuotedComment string
	Methods       []*Method
}

type Type

type Type struct {
	File    *File
	Message *Message
	Enum    *Enum
	Scalar  string
	Map     *Map
}

func (*Type) IsEnum

func (p *Type) IsEnum() bool

func (*Type) IsMap

func (p *Type) IsMap() bool

func (*Type) IsMessage

func (p *Type) IsMessage() bool

func (*Type) IsScalar

func (p *Type) IsScalar() bool

func (*Type) String

func (p *Type) String() string

type TypeName

type TypeName []string

func (TypeName) Equal

func (t TypeName) Equal(t2 TypeName) bool

func (TypeName) NewSubTypeName

func (t TypeName) NewSubTypeName(subName string) TypeName

Jump to

Keyboard shortcuts

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