reflectv1

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: May 19, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MessageField_Label_name = map[int32]string{
	0: "LABEL_INVALID",
	1: "LABEL_OPTIONAL",
	2: "LABEL_REQUIRED",
	3: "LABEL_REPEATED",
}
View Source
var MessageField_Label_value = map[string]int32{
	"LABEL_INVALID":  0,
	"LABEL_OPTIONAL": 1,
	"LABEL_REQUIRED": 2,
	"LABEL_REPEATED": 3,
}
View Source
var MessageField_Type_name = map[int32]string{
	0:  "TYPE_INVALID",
	1:  "TYPE_DOUBLE",
	2:  "TYPE_FLOAT",
	3:  "TYPE_INT64",
	4:  "TYPE_UINT64",
	5:  "TYPE_INT32",
	6:  "TYPE_FIXED64",
	7:  "TYPE_FIXED32",
	8:  "TYPE_BOOL",
	9:  "TYPE_STRING",
	10: "TYPE_GROUP",
	11: "TYPE_MESSAGE",
	12: "TYPE_BYTES",
	13: "TYPE_UINT32",
	14: "TYPE_ENUM",
	15: "TYPE_SFIXED32",
	16: "TYPE_SFIXED64",
	17: "TYPE_SINT32",
	18: "TYPE_SINT64",
}
View Source
var MessageField_Type_value = map[string]int32{
	"TYPE_INVALID":  0,
	"TYPE_DOUBLE":   1,
	"TYPE_FLOAT":    2,
	"TYPE_INT64":    3,
	"TYPE_UINT64":   4,
	"TYPE_INT32":    5,
	"TYPE_FIXED64":  6,
	"TYPE_FIXED32":  7,
	"TYPE_BOOL":     8,
	"TYPE_STRING":   9,
	"TYPE_GROUP":    10,
	"TYPE_MESSAGE":  11,
	"TYPE_BYTES":    12,
	"TYPE_UINT32":   13,
	"TYPE_ENUM":     14,
	"TYPE_SFIXED32": 15,
	"TYPE_SFIXED64": 16,
	"TYPE_SINT32":   17,
	"TYPE_SINT64":   18,
}

Functions

This section is empty.

Types

type Enum

type Enum struct {
	// name is the name of the enum.
	//
	// If this is a nested enum, this will not contain the name of the
	// encapsulating message.
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// enum_values contains the enum values.
	//
	// These will be sorted by number.
	EnumValues           []*EnumValue `protobuf:"bytes,2,rep,name=enum_values,json=enumValues,proto3" json:"enum_values,omitempty"`
	XXX_NoUnkeyedLiteral struct{}     `json:"-"`
	XXX_unrecognized     []byte       `json:"-"`
	XXX_sizecache        int32        `json:"-"`
}

Enum describes a Protobuf enum.

func (*Enum) Descriptor

func (*Enum) Descriptor() ([]byte, []int)

func (*Enum) GetEnumValues

func (m *Enum) GetEnumValues() []*EnumValue

func (*Enum) GetName

func (m *Enum) GetName() string

func (*Enum) ProtoMessage

func (*Enum) ProtoMessage()

func (*Enum) Reset

func (m *Enum) Reset()

func (*Enum) String

func (m *Enum) String() string

func (*Enum) XXX_DiscardUnknown

func (m *Enum) XXX_DiscardUnknown()

func (*Enum) XXX_Marshal

func (m *Enum) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Enum) XXX_Merge

func (m *Enum) XXX_Merge(src proto.Message)

func (*Enum) XXX_Size

func (m *Enum) XXX_Size() int

func (*Enum) XXX_Unmarshal

func (m *Enum) XXX_Unmarshal(b []byte) error

type EnumValue

type EnumValue struct {
	// name contains the value name.
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// number contains the value number.
	Number               int32    `protobuf:"varint,2,opt,name=number,proto3" json:"number,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

EnumValue describes a Protobuf enum value.

func (*EnumValue) Descriptor

func (*EnumValue) Descriptor() ([]byte, []int)

func (*EnumValue) GetName

func (m *EnumValue) GetName() string

func (*EnumValue) GetNumber

func (m *EnumValue) GetNumber() int32

func (*EnumValue) ProtoMessage

func (*EnumValue) ProtoMessage()

func (*EnumValue) Reset

func (m *EnumValue) Reset()

func (*EnumValue) String

func (m *EnumValue) String() string

func (*EnumValue) XXX_DiscardUnknown

func (m *EnumValue) XXX_DiscardUnknown()

func (*EnumValue) XXX_Marshal

func (m *EnumValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*EnumValue) XXX_Merge

func (m *EnumValue) XXX_Merge(src proto.Message)

func (*EnumValue) XXX_Size

func (m *EnumValue) XXX_Size() int

func (*EnumValue) XXX_Unmarshal

func (m *EnumValue) XXX_Unmarshal(b []byte) error

type Message

type Message struct {
	// name is the name of the message.
	//
	// If this is a nested message, this will not contain the name of the
	// encapsulating message.
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// message_fields contains the message fields.
	//
	// This does not include any extended fields.
	// These will be sorted by number.
	MessageFields []*MessageField `protobuf:"bytes,2,rep,name=message_fields,json=messageFields,proto3" json:"message_fields,omitempty"`
	// message_oneofs contains the oneofs.
	//
	// These will be sorted by name.
	MessageOneofs []*MessageOneof `protobuf:"bytes,3,rep,name=message_oneofs,json=messageOneofs,proto3" json:"message_oneofs,omitempty"`
	// nested_message contains the messages directly nested on this message.
	//
	// These will be sorted by name.
	NestedMessages []*Message `protobuf:"bytes,4,rep,name=nested_messages,json=nestedMessages,proto3" json:"nested_messages,omitempty"`
	// nested_enums contains the enums directed nested on this message.
	//
	// These will be sorted by name.
	NestedEnums          []*Enum  `protobuf:"bytes,5,rep,name=nested_enums,json=nestedEnums,proto3" json:"nested_enums,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

Message describes a Protobuf message.

func (*Message) Descriptor

func (*Message) Descriptor() ([]byte, []int)

func (*Message) GetMessageFields

func (m *Message) GetMessageFields() []*MessageField

func (*Message) GetMessageOneofs

func (m *Message) GetMessageOneofs() []*MessageOneof

func (*Message) GetName

func (m *Message) GetName() string

func (*Message) GetNestedEnums

func (m *Message) GetNestedEnums() []*Enum

func (*Message) GetNestedMessages

func (m *Message) GetNestedMessages() []*Message

func (*Message) ProtoMessage

func (*Message) ProtoMessage()

func (*Message) Reset

func (m *Message) Reset()

func (*Message) String

func (m *Message) String() string

func (*Message) XXX_DiscardUnknown

func (m *Message) XXX_DiscardUnknown()

func (*Message) XXX_Marshal

func (m *Message) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Message) XXX_Merge

func (m *Message) XXX_Merge(src proto.Message)

func (*Message) XXX_Size

func (m *Message) XXX_Size() int

func (*Message) XXX_Unmarshal

func (m *Message) XXX_Unmarshal(b []byte) error

type MessageField

type MessageField struct {
	// name is the name of the message field.
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// number is the number of the message field.
	Number int32 `protobuf:"varint,2,opt,name=number,proto3" json:"number,omitempty"`
	// label is the label of the message field.
	Label MessageField_Label `protobuf:"varint,3,opt,name=label,proto3,enum=uber.proto.reflect.v1.MessageField_Label" json:"label,omitempty"`
	// type is the type of the message field.
	Type MessageField_Type `protobuf:"varint,4,opt,name=type,proto3,enum=uber.proto.reflect.v1.MessageField_Type" json:"type,omitempty"`
	// type_name is the fully-qualified name of the type for message and enum
	// fields.
	//
	// This does not include the prefix '.' found in the traditional package
	// fully-qualified name. If this is a nested message, the parent messages
	// will be part of the name.
	TypeName             string   `protobuf:"bytes,5,opt,name=type_name,json=typeName,proto3" json:"type_name,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

MessageField describes a Protobuf message field.

func (*MessageField) Descriptor

func (*MessageField) Descriptor() ([]byte, []int)

func (*MessageField) GetLabel

func (m *MessageField) GetLabel() MessageField_Label

func (*MessageField) GetName

func (m *MessageField) GetName() string

func (*MessageField) GetNumber

func (m *MessageField) GetNumber() int32

func (*MessageField) GetType

func (m *MessageField) GetType() MessageField_Type

func (*MessageField) GetTypeName

func (m *MessageField) GetTypeName() string

func (*MessageField) ProtoMessage

func (*MessageField) ProtoMessage()

func (*MessageField) Reset

func (m *MessageField) Reset()

func (*MessageField) String

func (m *MessageField) String() string

func (*MessageField) XXX_DiscardUnknown

func (m *MessageField) XXX_DiscardUnknown()

func (*MessageField) XXX_Marshal

func (m *MessageField) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MessageField) XXX_Merge

func (m *MessageField) XXX_Merge(src proto.Message)

func (*MessageField) XXX_Size

func (m *MessageField) XXX_Size() int

func (*MessageField) XXX_Unmarshal

func (m *MessageField) XXX_Unmarshal(b []byte) error

type MessageField_Label

type MessageField_Label int32

Label is the label of the message field.

The numbers match the FieldDescriptorProto.Label numbers.

Note that a map field will come up as repeated, with type TYPE_MESSAGE, and the type_name will be *Entry. We may parse this from FieldDescriptorProtos in the future and add a LABEL_MAP.

const (
	MessageField_LABEL_INVALID  MessageField_Label = 0
	MessageField_LABEL_OPTIONAL MessageField_Label = 1
	MessageField_LABEL_REQUIRED MessageField_Label = 2
	MessageField_LABEL_REPEATED MessageField_Label = 3
)

func (MessageField_Label) EnumDescriptor

func (MessageField_Label) EnumDescriptor() ([]byte, []int)

func (MessageField_Label) String

func (x MessageField_Label) String() string

type MessageField_Type

type MessageField_Type int32

Type is the type of the message field.

The numbers match the FieldDescriptorProto.Type numbers.

const (
	MessageField_TYPE_INVALID  MessageField_Type = 0
	MessageField_TYPE_DOUBLE   MessageField_Type = 1
	MessageField_TYPE_FLOAT    MessageField_Type = 2
	MessageField_TYPE_INT64    MessageField_Type = 3
	MessageField_TYPE_UINT64   MessageField_Type = 4
	MessageField_TYPE_INT32    MessageField_Type = 5
	MessageField_TYPE_FIXED64  MessageField_Type = 6
	MessageField_TYPE_FIXED32  MessageField_Type = 7
	MessageField_TYPE_BOOL     MessageField_Type = 8
	MessageField_TYPE_STRING   MessageField_Type = 9
	MessageField_TYPE_GROUP    MessageField_Type = 10
	MessageField_TYPE_MESSAGE  MessageField_Type = 11
	MessageField_TYPE_BYTES    MessageField_Type = 12
	MessageField_TYPE_UINT32   MessageField_Type = 13
	MessageField_TYPE_ENUM     MessageField_Type = 14
	MessageField_TYPE_SFIXED32 MessageField_Type = 15
	MessageField_TYPE_SFIXED64 MessageField_Type = 16
	MessageField_TYPE_SINT32   MessageField_Type = 17
	MessageField_TYPE_SINT64   MessageField_Type = 18
)

func (MessageField_Type) EnumDescriptor

func (MessageField_Type) EnumDescriptor() ([]byte, []int)

func (MessageField_Type) String

func (x MessageField_Type) String() string

type MessageOneof

type MessageOneof struct {
	// name is the name of the message oneof.
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// field_numbers are the field numbers in the encapsulating type that make up
	// this message oneof.
	//
	// This will be sorted.
	FieldNumbers         []int32  `protobuf:"varint,2,rep,packed,name=field_numbers,json=fieldNumbers,proto3" json:"field_numbers,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

MessageOneof describes a Protobuf message oneof.

func (*MessageOneof) Descriptor

func (*MessageOneof) Descriptor() ([]byte, []int)

func (*MessageOneof) GetFieldNumbers

func (m *MessageOneof) GetFieldNumbers() []int32

func (*MessageOneof) GetName

func (m *MessageOneof) GetName() string

func (*MessageOneof) ProtoMessage

func (*MessageOneof) ProtoMessage()

func (*MessageOneof) Reset

func (m *MessageOneof) Reset()

func (*MessageOneof) String

func (m *MessageOneof) String() string

func (*MessageOneof) XXX_DiscardUnknown

func (m *MessageOneof) XXX_DiscardUnknown()

func (*MessageOneof) XXX_Marshal

func (m *MessageOneof) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MessageOneof) XXX_Merge

func (m *MessageOneof) XXX_Merge(src proto.Message)

func (*MessageOneof) XXX_Size

func (m *MessageOneof) XXX_Size() int

func (*MessageOneof) XXX_Unmarshal

func (m *MessageOneof) XXX_Unmarshal(b []byte) error

type Package

type Package struct {
	// name is the fully-qualified name of the package.
	//
	// The package name can be thought of as the unique identifier for a
	// Package message, and is used as a reference.
	//
	// This does not include the prefix '.' found in the traditional package
	// fully-qualified name.
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// dependency_names contains the names of this packages' dependencies.
	//
	// These will be sorted.
	// If you have a set of Package messages, this will correspond to the name
	// field of other Packages in the set.
	DependencyNames []string `protobuf:"bytes,2,rep,name=dependency_names,json=dependencyNames,proto3" json:"dependency_names,omitempty"`
	// enums contains the top-level enums within this package.
	//
	// These will be sorted by name.
	// Nested enums will be within Messages.
	Enums []*Enum `protobuf:"bytes,3,rep,name=enums,proto3" json:"enums,omitempty"`
	// messages contains the top-level messages within this package.
	//
	// These will be sorted by name.
	// Nested messages will be within Messages.
	Messages []*Message `protobuf:"bytes,4,rep,name=messages,proto3" json:"messages,omitempty"`
	// services contains the services within this package.
	//
	// These will be sorted by name.
	Services             []*Service `protobuf:"bytes,5,rep,name=services,proto3" json:"services,omitempty"`
	XXX_NoUnkeyedLiteral struct{}   `json:"-"`
	XXX_unrecognized     []byte     `json:"-"`
	XXX_sizecache        int32      `json:"-"`
}

Package describes a Protobuf package, constructed from a set of Protobuf files that have the same "package" value.

func (*Package) Descriptor

func (*Package) Descriptor() ([]byte, []int)

func (*Package) GetDependencyNames

func (m *Package) GetDependencyNames() []string

func (*Package) GetEnums

func (m *Package) GetEnums() []*Enum

func (*Package) GetMessages

func (m *Package) GetMessages() []*Message

func (*Package) GetName

func (m *Package) GetName() string

func (*Package) GetServices

func (m *Package) GetServices() []*Service

func (*Package) ProtoMessage

func (*Package) ProtoMessage()

func (*Package) Reset

func (m *Package) Reset()

func (*Package) String

func (m *Package) String() string

func (*Package) XXX_DiscardUnknown

func (m *Package) XXX_DiscardUnknown()

func (*Package) XXX_Marshal

func (m *Package) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Package) XXX_Merge

func (m *Package) XXX_Merge(src proto.Message)

func (*Package) XXX_Size

func (m *Package) XXX_Size() int

func (*Package) XXX_Unmarshal

func (m *Package) XXX_Unmarshal(b []byte) error

type PackageSet

type PackageSet struct {
	// packages contains the set of Packages.
	//
	// These will all be unique, and can be referenced by their name field.
	// These will also be sorted by name.
	Packages             []*Package `protobuf:"bytes,1,rep,name=packages,proto3" json:"packages,omitempty"`
	XXX_NoUnkeyedLiteral struct{}   `json:"-"`
	XXX_unrecognized     []byte     `json:"-"`
	XXX_sizecache        int32      `json:"-"`
}

PackageSet is a set of Packages.

func (*PackageSet) Descriptor

func (*PackageSet) Descriptor() ([]byte, []int)

func (*PackageSet) GetPackages

func (m *PackageSet) GetPackages() []*Package

func (*PackageSet) ProtoMessage

func (*PackageSet) ProtoMessage()

func (*PackageSet) Reset

func (m *PackageSet) Reset()

func (*PackageSet) String

func (m *PackageSet) String() string

func (*PackageSet) XXX_DiscardUnknown

func (m *PackageSet) XXX_DiscardUnknown()

func (*PackageSet) XXX_Marshal

func (m *PackageSet) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*PackageSet) XXX_Merge

func (m *PackageSet) XXX_Merge(src proto.Message)

func (*PackageSet) XXX_Size

func (m *PackageSet) XXX_Size() int

func (*PackageSet) XXX_Unmarshal

func (m *PackageSet) XXX_Unmarshal(b []byte) error

type Service

type Service struct {
	// name is the name of the service.
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// service_methods are the service methods.
	//
	// These will be sorted by name.
	ServiceMethods       []*ServiceMethod `protobuf:"bytes,2,rep,name=service_methods,json=serviceMethods,proto3" json:"service_methods,omitempty"`
	XXX_NoUnkeyedLiteral struct{}         `json:"-"`
	XXX_unrecognized     []byte           `json:"-"`
	XXX_sizecache        int32            `json:"-"`
}

Service describes a Protobuf service.

func (*Service) Descriptor

func (*Service) Descriptor() ([]byte, []int)

func (*Service) GetName

func (m *Service) GetName() string

func (*Service) GetServiceMethods

func (m *Service) GetServiceMethods() []*ServiceMethod

func (*Service) ProtoMessage

func (*Service) ProtoMessage()

func (*Service) Reset

func (m *Service) Reset()

func (*Service) String

func (m *Service) String() string

func (*Service) XXX_DiscardUnknown

func (m *Service) XXX_DiscardUnknown()

func (*Service) XXX_Marshal

func (m *Service) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Service) XXX_Merge

func (m *Service) XXX_Merge(src proto.Message)

func (*Service) XXX_Size

func (m *Service) XXX_Size() int

func (*Service) XXX_Unmarshal

func (m *Service) XXX_Unmarshal(b []byte) error

type ServiceMethod

type ServiceMethod struct {
	// name is the name of the service method.
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// request_type_name is the fully-qualified name of request message type.
	//
	// This does not include the prefix '.' found in the traditional package
	// fully-qualified name. If this is a nested message, the parent messages
	// will be part of the name.
	RequestTypeName string `protobuf:"bytes,2,opt,name=request_type_name,json=requestTypeName,proto3" json:"request_type_name,omitempty"`
	// response_type_name is the fully-qualified name of response message type.
	//
	// This does not include the prefix '.' found in the traditional package
	// fully-qualified name. If this is a nested message, the parent messages
	// will be part of the name.
	ResponseTypeName string `protobuf:"bytes,3,opt,name=response_type_name,json=responseTypeName,proto3" json:"response_type_name,omitempty"`
	// client_streaming representing whether this is a client-side streaming
	// method
	ClientStreaming bool `protobuf:"varint,4,opt,name=client_streaming,json=clientStreaming,proto3" json:"client_streaming,omitempty"`
	// server_streaming representing whether this is a server-side streaming
	// method
	ServerStreaming      bool     `protobuf:"varint,5,opt,name=server_streaming,json=serverStreaming,proto3" json:"server_streaming,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

ServiceMethod describes a Protobuf service method.

func (*ServiceMethod) Descriptor

func (*ServiceMethod) Descriptor() ([]byte, []int)

func (*ServiceMethod) GetClientStreaming

func (m *ServiceMethod) GetClientStreaming() bool

func (*ServiceMethod) GetName

func (m *ServiceMethod) GetName() string

func (*ServiceMethod) GetRequestTypeName

func (m *ServiceMethod) GetRequestTypeName() string

func (*ServiceMethod) GetResponseTypeName

func (m *ServiceMethod) GetResponseTypeName() string

func (*ServiceMethod) GetServerStreaming

func (m *ServiceMethod) GetServerStreaming() bool

func (*ServiceMethod) ProtoMessage

func (*ServiceMethod) ProtoMessage()

func (*ServiceMethod) Reset

func (m *ServiceMethod) Reset()

func (*ServiceMethod) String

func (m *ServiceMethod) String() string

func (*ServiceMethod) XXX_DiscardUnknown

func (m *ServiceMethod) XXX_DiscardUnknown()

func (*ServiceMethod) XXX_Marshal

func (m *ServiceMethod) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ServiceMethod) XXX_Merge

func (m *ServiceMethod) XXX_Merge(src proto.Message)

func (*ServiceMethod) XXX_Size

func (m *ServiceMethod) XXX_Size() int

func (*ServiceMethod) XXX_Unmarshal

func (m *ServiceMethod) XXX_Unmarshal(b []byte) error

Jump to

Keyboard shortcuts

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