registry

package
v0.0.0-...-6c789bd Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2020 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package registry provides registries for Protocol Buffers descriptors.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Enum

type Enum interface {
	Protobuf() *protobuf.Enum

	GetFieldByName(name string) (*EnumField, bool)

	GetFieldByLine(line int) (*EnumField, bool)
}

Enum is a registry for protobuf enum.

func NewEnum

func NewEnum(protoEnum *protobuf.Enum) Enum

NewEnum returns Enum initialized by provided *protobuf.Enum.

type EnumField

type EnumField struct {
	ProtoEnumField *protobuf.EnumField
}

EnumField is a registry for protobuf enum field.

func NewEnumField

func NewEnumField(protoMessage *protobuf.EnumField) *EnumField

NewEnumField returns EnumField initialized by provided *protobuf.EnumField.

type MapField

type MapField struct {
	ProtoMapField *protobuf.MapField
}

MapField is a registry for protobuf enum field.

func NewMapField

func NewMapField(protoMapField *protobuf.MapField) *MapField

NewMapField returns MapField initialized by provided *protobuf.MapField.

type Message

type Message interface {
	Protobuf() *protobuf.Message

	NestedMessages() []Message
	NestedEnums() []Enum
	Fields() []*MessageField
	Oneofs() []Oneof
	MapFields() []*MapField

	GetNestedMessageByName(name string) (Message, bool)
	GetNestedEnumByName(name string) (Enum, bool)

	GetFieldByName(name string) (*MessageField, bool)
	GetOneofFieldByName(name string) (Oneof, bool)
	GetMapFieldByName(name string) (*MapField, bool)

	GetFieldByLine(line int) (*MessageField, bool)
	GetOneofFieldByLine(line int) (Oneof, bool)
	GetMapFieldByLine(line int) (*MapField, bool)
}

Message is a registry for protobuf message.

func NewMessage

func NewMessage(protoMessage *protobuf.Message) Message

NewMessage returns Message initialized by provided *protobuf.Message.

type MessageField

type MessageField struct {
	ProtoField *protobuf.NormalField
}

MessageField is a registry for protobuf message field.

func NewMessageField

func NewMessageField(protoMessage *protobuf.NormalField) *MessageField

NewMessageField returns MessageField initialized by provided *protobuf.MessageField.

type Oneof

type Oneof interface {
	Protobuf() *protobuf.Oneof

	GetFieldByName(name string) (*OneofField, bool)

	GetFieldByLine(line int) (*OneofField, bool)
}

Oneof is a registry for protobuf oneof.

func NewOneof

func NewOneof(protoOneofField *protobuf.Oneof) Oneof

NewOneof returns Oneof initialized by provided *protobuf.Oneof.

type OneofField

type OneofField struct {
	ProtoOneOfField *protobuf.OneOfField
}

OneofField is a registry for protobuf oneof field.

func NewOneofField

func NewOneofField(protoOneOfField *protobuf.OneOfField) *OneofField

NewOneofField returns OneofField initialized by provided *protobuf.OneofField.

type Package

type Package struct {
	ProtoPackage *protobuf.Package
}

Package is a registry for protobuf package.

func NewPackage

func NewPackage(protoPackage *protobuf.Package) *Package

NewPackage returns Package initialized by provided *protobuf.Package.

type Proto

type Proto interface {
	Protobuf() *protobuf.Proto

	Packages() []*Package
	Messages() []Message
	Enums() []Enum
	Services() []Service

	GetPackageByName(name string) (*Package, bool)
	GetMessageByName(name string) (Message, bool)
	GetEnumByName(name string) (Enum, bool)
	GetServiceByName(name string) (Service, bool)

	GetPackageByLine(line int) (*Package, bool)
	GetMessageByLine(line int) (Message, bool)
	GetEnumByLine(line int) (Enum, bool)
	GetServiceByLine(line int) (Service, bool)

	GetMessageFieldByLine(line int) (*MessageField, bool)
	GetEnumFieldByLine(line int) (*EnumField, bool)
}

Proto is a registry for protobuf proto.

func NewProto

func NewProto(protoProto *protobuf.Proto) Proto

NewProto returns Proto initialized by provided *protobuf.Proto.

type ProtoSet

type ProtoSet interface {
	Protos() []Proto
	Append(proto *protobuf.Proto)

	GetProtoByFilename(filename string) (Proto, bool)
}

ProtoSet is a registry for Proto.

func NewProtoSet

func NewProtoSet(protos ...*protobuf.Proto) ProtoSet

NewProtoSet returns protoSet initialized by provided []*protobuf.Proto.

type RPC

type RPC struct {
	ProtoRPC *protobuf.RPC
}

RPC is a registry for protobuf rpc.

func NewRPC

func NewRPC(protoRPC *protobuf.RPC) *RPC

NewRPC returns RPC initialized by provided *protobuf.RPC.

type Service

type Service interface {
	Protobuf() *protobuf.Service

	RPCs() []*RPC

	GetRPCByName(bool string) (*RPC, bool)

	GetRPCByLine(line int) (*RPC, bool)
}

Service is a registry for protobuf service.

func NewService

func NewService(protoService *protobuf.Service) Service

NewService returns Service initialized by provided *protobuf.Service.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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