Documentation ¶
Overview ¶
Package filedesc provides functionality for constructing descriptors.
The types in this package implement interfaces in the protoreflect package related to protobuf descripriptors.
Index ¶
- Variables
- func DefaultValue(v pref.Value, ev pref.EnumValueDescriptor) defaultValue
- type Base
- func (d *Base) FullName() pref.FullName
- func (d *Base) Index() int
- func (d *Base) IsPlaceholder() bool
- func (d *Base) Name() pref.Name
- func (d *Base) Parent() pref.Descriptor
- func (d *Base) ParentFile() pref.FileDescriptor
- func (d *Base) ProtoInternal(pragma.DoNotImplement)
- func (d *Base) Syntax() pref.Syntax
- type BaseL0
- type Builder
- type Enum
- type EnumL1
- type EnumL2
- type EnumRanges
- type EnumValue
- type EnumValueL1
- type EnumValues
- func (p *EnumValues) ByName(s protoreflect.Name) protoreflect.EnumValueDescriptor
- func (p *EnumValues) ByNumber(n protoreflect.EnumNumber) protoreflect.EnumValueDescriptor
- func (p *EnumValues) Format(s fmt.State, r rune)
- func (p *EnumValues) Get(i int) protoreflect.EnumValueDescriptor
- func (p *EnumValues) Len() int
- func (p *EnumValues) ProtoInternal(pragma.DoNotImplement)
- type Enums
- type Extension
- func (xd *Extension) Cardinality() pref.Cardinality
- func (xd *Extension) ContainingMessage() pref.MessageDescriptor
- func (xd *Extension) ContainingOneof() pref.OneofDescriptor
- func (xd *Extension) Default() pref.Value
- func (xd *Extension) DefaultEnumValue() pref.EnumValueDescriptor
- func (xd *Extension) Enum() pref.EnumDescriptor
- func (xd *Extension) Format(s fmt.State, r rune)
- func (xd *Extension) HasDefault() bool
- func (xd *Extension) HasJSONName() bool
- func (xd *Extension) HasOptionalKeyword() bool
- func (xd *Extension) HasPresence() bool
- func (xd *Extension) IsExtension() bool
- func (xd *Extension) IsList() bool
- func (xd *Extension) IsMap() bool
- func (xd *Extension) IsPacked() bool
- func (xd *Extension) IsWeak() bool
- func (xd *Extension) JSONName() string
- func (xd *Extension) Kind() pref.Kind
- func (xd *Extension) MapKey() pref.FieldDescriptor
- func (xd *Extension) MapValue() pref.FieldDescriptor
- func (xd *Extension) Message() pref.MessageDescriptor
- func (xd *Extension) Number() pref.FieldNumber
- func (xd *Extension) Options() pref.ProtoMessage
- func (xd *Extension) ProtoInternal(pragma.DoNotImplement)
- func (xd *Extension) ProtoType(pref.FieldDescriptor)
- func (xd *Extension) TextName() string
- type ExtensionL1
- type ExtensionL2
- type Extensions
- type Field
- func (fd *Field) Cardinality() pref.Cardinality
- func (fd *Field) ContainingMessage() pref.MessageDescriptor
- func (fd *Field) ContainingOneof() pref.OneofDescriptor
- func (fd *Field) Default() pref.Value
- func (fd *Field) DefaultEnumValue() pref.EnumValueDescriptor
- func (fd *Field) EnforceUTF8() bool
- func (fd *Field) Enum() pref.EnumDescriptor
- func (fd *Field) Format(s fmt.State, r rune)
- func (fd *Field) HasDefault() bool
- func (fd *Field) HasJSONName() bool
- func (fd *Field) HasOptionalKeyword() bool
- func (fd *Field) HasPresence() bool
- func (fd *Field) IsExtension() bool
- func (fd *Field) IsList() bool
- func (fd *Field) IsMap() bool
- func (fd *Field) IsPacked() bool
- func (fd *Field) IsWeak() bool
- func (fd *Field) JSONName() string
- func (fd *Field) Kind() pref.Kind
- func (fd *Field) MapKey() pref.FieldDescriptor
- func (fd *Field) MapValue() pref.FieldDescriptor
- func (fd *Field) Message() pref.MessageDescriptor
- func (fd *Field) Number() pref.FieldNumber
- func (fd *Field) Options() pref.ProtoMessage
- func (fd *Field) ProtoType(pref.FieldDescriptor)
- func (fd *Field) TextName() string
- type FieldL1
- type FieldNumbers
- type FieldRanges
- func (p *FieldRanges) CheckOverlap(q *FieldRanges) error
- func (p *FieldRanges) CheckValid(isMessageSet bool) error
- func (p *FieldRanges) Format(s fmt.State, r rune)
- func (p *FieldRanges) Get(i int) [2]pref.FieldNumber
- func (p *FieldRanges) Has(n pref.FieldNumber) bool
- func (p *FieldRanges) Len() int
- func (p *FieldRanges) ProtoInternal(pragma.DoNotImplement)
- type Fields
- func (p *Fields) ByJSONName(s string) protoreflect.FieldDescriptor
- func (p *Fields) ByName(s protoreflect.Name) protoreflect.FieldDescriptor
- func (p *Fields) ByNumber(n protoreflect.FieldNumber) protoreflect.FieldDescriptor
- func (p *Fields) ByTextName(s string) protoreflect.FieldDescriptor
- func (p *Fields) Format(s fmt.State, r rune)
- func (p *Fields) Get(i int) protoreflect.FieldDescriptor
- func (p *Fields) Len() int
- func (p *Fields) ProtoInternal(pragma.DoNotImplement)
- type File
- func (fd *File) Enums() pref.EnumDescriptors
- func (fd *File) Extensions() pref.ExtensionDescriptors
- func (fd *File) Format(s fmt.State, r rune)
- func (fd *File) FullName() pref.FullName
- func (fd *File) GoPackagePath() string
- func (fd *File) Imports() pref.FileImports
- func (fd *File) Index() int
- func (fd *File) IsPlaceholder() bool
- func (fd *File) Messages() pref.MessageDescriptors
- func (fd *File) Name() pref.Name
- func (fd *File) Options() pref.ProtoMessage
- func (fd *File) Package() pref.FullName
- func (fd *File) Parent() pref.Descriptor
- func (fd *File) ParentFile() pref.FileDescriptor
- func (fd *File) Path() string
- func (fd *File) ProtoInternal(pragma.DoNotImplement)
- func (fd *File) ProtoType(pref.FileDescriptor)
- func (fd *File) Services() pref.ServiceDescriptors
- func (fd *File) SourceLocations() pref.SourceLocations
- func (fd *File) Syntax() pref.Syntax
- type FileImports
- type FileL1
- type FileL2
- type Message
- func (md *Message) Enums() pref.EnumDescriptors
- func (md *Message) ExtensionRangeOptions(i int) pref.ProtoMessage
- func (md *Message) ExtensionRanges() pref.FieldRanges
- func (md *Message) Extensions() pref.ExtensionDescriptors
- func (md *Message) Fields() pref.FieldDescriptors
- func (md *Message) Format(s fmt.State, r rune)
- func (md *Message) IsMapEntry() bool
- func (md *Message) IsMessageSet() bool
- func (md *Message) Messages() pref.MessageDescriptors
- func (md *Message) Oneofs() pref.OneofDescriptors
- func (md *Message) Options() pref.ProtoMessage
- func (md *Message) ProtoType(pref.MessageDescriptor)
- func (md *Message) RequiredNumbers() pref.FieldNumbers
- func (md *Message) ReservedNames() pref.Names
- func (md *Message) ReservedRanges() pref.FieldRanges
- type MessageL1
- type MessageL2
- type Messages
- type Method
- func (md *Method) Format(s fmt.State, r rune)
- func (md *Method) Input() pref.MessageDescriptor
- func (md *Method) IsStreamingClient() bool
- func (md *Method) IsStreamingServer() bool
- func (md *Method) Options() pref.ProtoMessage
- func (md *Method) Output() pref.MessageDescriptor
- func (md *Method) ProtoInternal(pragma.DoNotImplement)
- func (md *Method) ProtoType(pref.MethodDescriptor)
- type MethodL1
- type Methods
- type Names
- type Oneof
- type OneofFields
- func (p *OneofFields) ByJSONName(s string) pref.FieldDescriptor
- func (p *OneofFields) ByName(s pref.Name) pref.FieldDescriptor
- func (p *OneofFields) ByNumber(n pref.FieldNumber) pref.FieldDescriptor
- func (p *OneofFields) ByTextName(s string) pref.FieldDescriptor
- func (p *OneofFields) Format(s fmt.State, r rune)
- func (p *OneofFields) Get(i int) pref.FieldDescriptor
- func (p *OneofFields) Len() int
- func (p *OneofFields) ProtoInternal(pragma.DoNotImplement)
- type OneofL1
- type Oneofs
- type Out
- type PlaceholderEnum
- func (e PlaceholderEnum) FullName() pref.FullName
- func (e PlaceholderEnum) Index() int
- func (e PlaceholderEnum) IsPlaceholder() bool
- func (e PlaceholderEnum) Name() pref.Name
- func (e PlaceholderEnum) Options() pref.ProtoMessage
- func (e PlaceholderEnum) Parent() pref.Descriptor
- func (e PlaceholderEnum) ParentFile() pref.FileDescriptor
- func (e PlaceholderEnum) ProtoInternal(pragma.DoNotImplement)
- func (e PlaceholderEnum) ProtoType(pref.EnumDescriptor)
- func (e PlaceholderEnum) ReservedNames() pref.Names
- func (e PlaceholderEnum) ReservedRanges() pref.EnumRanges
- func (e PlaceholderEnum) Syntax() pref.Syntax
- func (e PlaceholderEnum) Values() pref.EnumValueDescriptors
- type PlaceholderEnumValue
- func (e PlaceholderEnumValue) FullName() pref.FullName
- func (e PlaceholderEnumValue) Index() int
- func (e PlaceholderEnumValue) IsPlaceholder() bool
- func (e PlaceholderEnumValue) Name() pref.Name
- func (e PlaceholderEnumValue) Number() pref.EnumNumber
- func (e PlaceholderEnumValue) Options() pref.ProtoMessage
- func (e PlaceholderEnumValue) Parent() pref.Descriptor
- func (e PlaceholderEnumValue) ParentFile() pref.FileDescriptor
- func (e PlaceholderEnumValue) ProtoInternal(pragma.DoNotImplement)
- func (e PlaceholderEnumValue) ProtoType(pref.EnumValueDescriptor)
- func (e PlaceholderEnumValue) Syntax() pref.Syntax
- type PlaceholderFile
- func (f PlaceholderFile) Enums() pref.EnumDescriptors
- func (f PlaceholderFile) Extensions() pref.ExtensionDescriptors
- func (f PlaceholderFile) FullName() pref.FullName
- func (f PlaceholderFile) Imports() pref.FileImports
- func (f PlaceholderFile) Index() int
- func (f PlaceholderFile) IsPlaceholder() bool
- func (f PlaceholderFile) Messages() pref.MessageDescriptors
- func (f PlaceholderFile) Name() pref.Name
- func (f PlaceholderFile) Options() pref.ProtoMessage
- func (f PlaceholderFile) Package() pref.FullName
- func (f PlaceholderFile) Parent() pref.Descriptor
- func (f PlaceholderFile) ParentFile() pref.FileDescriptor
- func (f PlaceholderFile) Path() string
- func (f PlaceholderFile) ProtoInternal(pragma.DoNotImplement)
- func (f PlaceholderFile) ProtoType(pref.FileDescriptor)
- func (f PlaceholderFile) Services() pref.ServiceDescriptors
- func (f PlaceholderFile) SourceLocations() pref.SourceLocations
- func (f PlaceholderFile) Syntax() pref.Syntax
- type PlaceholderMessage
- func (m PlaceholderMessage) Enums() pref.EnumDescriptors
- func (m PlaceholderMessage) ExtensionRangeOptions(int) pref.ProtoMessage
- func (m PlaceholderMessage) ExtensionRanges() pref.FieldRanges
- func (m PlaceholderMessage) Extensions() pref.ExtensionDescriptors
- func (m PlaceholderMessage) Fields() pref.FieldDescriptors
- func (m PlaceholderMessage) FullName() pref.FullName
- func (m PlaceholderMessage) Index() int
- func (m PlaceholderMessage) IsMapEntry() bool
- func (m PlaceholderMessage) IsPlaceholder() bool
- func (m PlaceholderMessage) Messages() pref.MessageDescriptors
- func (m PlaceholderMessage) Name() pref.Name
- func (m PlaceholderMessage) Oneofs() pref.OneofDescriptors
- func (m PlaceholderMessage) Options() pref.ProtoMessage
- func (m PlaceholderMessage) Parent() pref.Descriptor
- func (m PlaceholderMessage) ParentFile() pref.FileDescriptor
- func (m PlaceholderMessage) ProtoInternal(pragma.DoNotImplement)
- func (m PlaceholderMessage) ProtoType(pref.MessageDescriptor)
- func (m PlaceholderMessage) RequiredNumbers() pref.FieldNumbers
- func (m PlaceholderMessage) ReservedNames() pref.Names
- func (m PlaceholderMessage) ReservedRanges() pref.FieldRanges
- func (m PlaceholderMessage) Syntax() pref.Syntax
- type Service
- type ServiceL1
- type ServiceL2
- type Services
- type SourceLocations
- func (p *SourceLocations) ByDescriptor(desc pref.Descriptor) pref.SourceLocation
- func (p *SourceLocations) ByPath(path pref.SourcePath) pref.SourceLocation
- func (p *SourceLocations) Get(i int) pref.SourceLocation
- func (p *SourceLocations) Len() int
- func (p *SourceLocations) ProtoInternal(pragma.DoNotImplement)
Constants ¶
This section is empty.
Variables ¶
var ( SurrogateProto2 = &File{L1: FileL1{Syntax: pref.Proto2}, L2: &FileL2{}} SurrogateProto3 = &File{L1: FileL1{Syntax: pref.Proto3}, L2: &FileL2{}} )
Surrogate files are can be used to create standalone descriptors where the syntax is only information derived from the parent file.
Functions ¶
func DefaultValue ¶
func DefaultValue(v pref.Value, ev pref.EnumValueDescriptor) defaultValue
Types ¶
type Base ¶
type Base struct {
L0 BaseL0
}
func (*Base) IsPlaceholder ¶
func (*Base) Parent ¶
func (d *Base) Parent() pref.Descriptor
func (*Base) ParentFile ¶
func (d *Base) ParentFile() pref.FileDescriptor
func (*Base) ProtoInternal ¶
func (d *Base) ProtoInternal(pragma.DoNotImplement)
type Builder ¶
type Builder struct { // GoPackagePath is the Go package path that is invoking this builder. GoPackagePath string // RawDescriptor is the wire-encoded bytes of FileDescriptorProto // and must be populated. RawDescriptor []byte // NumEnums is the total number of enums declared in the file. NumEnums int32 // NumMessages is the total number of messages declared in the file. // It includes the implicit message declarations for map entries. NumMessages int32 // NumExtensions is the total number of extensions declared in the file. NumExtensions int32 // NumServices is the total number of services declared in the file. NumServices int32 // TypeResolver resolves extension field types for descriptor options. // If nil, it uses protoregistry.GlobalTypes. TypeResolver interface { preg.ExtensionTypeResolver } // FileRegistry is use to lookup file, enum, and message dependencies. // Once constructed, the file descriptor is registered here. // If nil, it uses protoregistry.GlobalFiles. FileRegistry interface { FindFileByPath(string) (protoreflect.FileDescriptor, error) FindDescriptorByName(pref.FullName) (pref.Descriptor, error) RegisterFile(pref.FileDescriptor) error } }
Builder construct a protoreflect.FileDescriptor from the raw descriptor.
func (Builder) Build ¶
Build constructs a FileDescriptor given the parameters set in Builder. It assumes that the inputs are well-formed and panics if any inconsistencies are encountered.
If NumEnums+NumMessages+NumExtensions+NumServices is zero, then Build automatically derives them from the raw descriptor.
type Enum ¶
func (*Enum) Options ¶
func (ed *Enum) Options() pref.ProtoMessage
func (*Enum) ProtoType ¶
func (ed *Enum) ProtoType(pref.EnumDescriptor)
func (*Enum) ReservedNames ¶
func (*Enum) ReservedRanges ¶
func (ed *Enum) ReservedRanges() pref.EnumRanges
func (*Enum) Values ¶
func (ed *Enum) Values() pref.EnumValueDescriptors
type EnumL2 ¶
type EnumL2 struct { Options func() pref.ProtoMessage Values EnumValues ReservedNames Names ReservedRanges EnumRanges }
type EnumRanges ¶
type EnumRanges struct { List [][2]pref.EnumNumber // start inclusive; end inclusive // contains filtered or unexported fields }
func (*EnumRanges) CheckValid ¶
func (p *EnumRanges) CheckValid() error
CheckValid reports any errors with the set of names with an error message that completes the sentence: "ranges is invalid because it has ..."
func (*EnumRanges) Get ¶
func (p *EnumRanges) Get(i int) [2]pref.EnumNumber
func (*EnumRanges) Has ¶
func (p *EnumRanges) Has(n pref.EnumNumber) bool
func (*EnumRanges) Len ¶
func (p *EnumRanges) Len() int
func (*EnumRanges) ProtoInternal ¶
func (p *EnumRanges) ProtoInternal(pragma.DoNotImplement)
type EnumValue ¶
type EnumValue struct { Base L1 EnumValueL1 }
func (*EnumValue) Number ¶
func (ed *EnumValue) Number() pref.EnumNumber
func (*EnumValue) Options ¶
func (ed *EnumValue) Options() pref.ProtoMessage
func (*EnumValue) ProtoType ¶
func (ed *EnumValue) ProtoType(pref.EnumValueDescriptor)
type EnumValueL1 ¶
type EnumValueL1 struct { Options func() pref.ProtoMessage Number pref.EnumNumber }
type EnumValues ¶
type EnumValues struct { List []EnumValue // contains filtered or unexported fields }
func (*EnumValues) ByName ¶
func (p *EnumValues) ByName(s protoreflect.Name) protoreflect.EnumValueDescriptor
func (*EnumValues) ByNumber ¶
func (p *EnumValues) ByNumber(n protoreflect.EnumNumber) protoreflect.EnumValueDescriptor
func (*EnumValues) Get ¶
func (p *EnumValues) Get(i int) protoreflect.EnumValueDescriptor
func (*EnumValues) Len ¶
func (p *EnumValues) Len() int
func (*EnumValues) ProtoInternal ¶
func (p *EnumValues) ProtoInternal(pragma.DoNotImplement)
type Enums ¶
type Enums struct { List []Enum // contains filtered or unexported fields }
func (*Enums) ByName ¶
func (p *Enums) ByName(s protoreflect.Name) protoreflect.EnumDescriptor
func (*Enums) Get ¶
func (p *Enums) Get(i int) protoreflect.EnumDescriptor
func (*Enums) ProtoInternal ¶
func (p *Enums) ProtoInternal(pragma.DoNotImplement)
type Extension ¶
type Extension struct { Base L1 ExtensionL1 L2 *ExtensionL2 // protected by fileDesc.once }
func (*Extension) Cardinality ¶
func (xd *Extension) Cardinality() pref.Cardinality
func (*Extension) ContainingMessage ¶
func (xd *Extension) ContainingMessage() pref.MessageDescriptor
func (*Extension) ContainingOneof ¶
func (xd *Extension) ContainingOneof() pref.OneofDescriptor
func (*Extension) DefaultEnumValue ¶
func (xd *Extension) DefaultEnumValue() pref.EnumValueDescriptor
func (*Extension) Enum ¶
func (xd *Extension) Enum() pref.EnumDescriptor
func (*Extension) HasDefault ¶
func (*Extension) HasJSONName ¶
func (*Extension) HasOptionalKeyword ¶
func (*Extension) HasPresence ¶
func (*Extension) IsExtension ¶
func (*Extension) MapKey ¶
func (xd *Extension) MapKey() pref.FieldDescriptor
func (*Extension) MapValue ¶
func (xd *Extension) MapValue() pref.FieldDescriptor
func (*Extension) Message ¶
func (xd *Extension) Message() pref.MessageDescriptor
func (*Extension) Number ¶
func (xd *Extension) Number() pref.FieldNumber
func (*Extension) Options ¶
func (xd *Extension) Options() pref.ProtoMessage
func (*Extension) ProtoInternal ¶
func (xd *Extension) ProtoInternal(pragma.DoNotImplement)
func (*Extension) ProtoType ¶
func (xd *Extension) ProtoType(pref.FieldDescriptor)
type ExtensionL1 ¶
type ExtensionL1 struct { Number pref.FieldNumber Extendee pref.MessageDescriptor Cardinality pref.Cardinality Kind pref.Kind }
type ExtensionL2 ¶
type ExtensionL2 struct { Options func() pref.ProtoMessage StringName stringName IsProto3Optional bool // promoted from google.protobuf.FieldDescriptorProto IsPacked bool // promoted from google.protobuf.FieldOptions Default defaultValue Enum pref.EnumDescriptor Message pref.MessageDescriptor }
type Extensions ¶
type Extensions struct { List []Extension // contains filtered or unexported fields }
func (*Extensions) ByName ¶
func (p *Extensions) ByName(s protoreflect.Name) protoreflect.ExtensionDescriptor
func (*Extensions) Get ¶
func (p *Extensions) Get(i int) protoreflect.ExtensionDescriptor
func (*Extensions) Len ¶
func (p *Extensions) Len() int
func (*Extensions) ProtoInternal ¶
func (p *Extensions) ProtoInternal(pragma.DoNotImplement)
type Field ¶
func (*Field) Cardinality ¶
func (fd *Field) Cardinality() pref.Cardinality
func (*Field) ContainingMessage ¶
func (fd *Field) ContainingMessage() pref.MessageDescriptor
func (*Field) ContainingOneof ¶
func (fd *Field) ContainingOneof() pref.OneofDescriptor
func (*Field) DefaultEnumValue ¶
func (fd *Field) DefaultEnumValue() pref.EnumValueDescriptor
func (*Field) EnforceUTF8 ¶
EnforceUTF8 is a pseudo-internal API to determine whether to enforce UTF-8 validation for the string field. This exists for Google-internal use only since proto3 did not enforce UTF-8 validity prior to the open-source release. If this method does not exist, the default is to enforce valid UTF-8.
WARNING: This method is exempt from the compatibility promise and may be removed in the future without warning.
func (*Field) Enum ¶
func (fd *Field) Enum() pref.EnumDescriptor
func (*Field) HasDefault ¶
func (*Field) HasJSONName ¶
func (*Field) HasOptionalKeyword ¶
func (*Field) HasPresence ¶
func (*Field) IsExtension ¶
func (*Field) MapKey ¶
func (fd *Field) MapKey() pref.FieldDescriptor
func (*Field) MapValue ¶
func (fd *Field) MapValue() pref.FieldDescriptor
func (*Field) Message ¶
func (fd *Field) Message() pref.MessageDescriptor
func (*Field) Number ¶
func (fd *Field) Number() pref.FieldNumber
func (*Field) Options ¶
func (fd *Field) Options() pref.ProtoMessage
func (*Field) ProtoType ¶
func (fd *Field) ProtoType(pref.FieldDescriptor)
type FieldL1 ¶
type FieldL1 struct { Options func() pref.ProtoMessage Number pref.FieldNumber Cardinality pref.Cardinality // must be consistent with Message.RequiredNumbers Kind pref.Kind StringName stringName IsProto3Optional bool // promoted from google.protobuf.FieldDescriptorProto IsWeak bool // promoted from google.protobuf.FieldOptions HasPacked bool // promoted from google.protobuf.FieldOptions IsPacked bool // promoted from google.protobuf.FieldOptions HasEnforceUTF8 bool // promoted from google.protobuf.FieldOptions EnforceUTF8 bool // promoted from google.protobuf.FieldOptions Default defaultValue ContainingOneof pref.OneofDescriptor // must be consistent with Message.Oneofs.Fields Enum pref.EnumDescriptor Message pref.MessageDescriptor }
type FieldNumbers ¶
type FieldNumbers struct { List []pref.FieldNumber // contains filtered or unexported fields }
func (*FieldNumbers) Get ¶
func (p *FieldNumbers) Get(i int) pref.FieldNumber
func (*FieldNumbers) Has ¶
func (p *FieldNumbers) Has(n pref.FieldNumber) bool
func (*FieldNumbers) Len ¶
func (p *FieldNumbers) Len() int
func (*FieldNumbers) ProtoInternal ¶
func (p *FieldNumbers) ProtoInternal(pragma.DoNotImplement)
type FieldRanges ¶
type FieldRanges struct { List [][2]pref.FieldNumber // start inclusive; end exclusive // contains filtered or unexported fields }
func (*FieldRanges) CheckOverlap ¶
func (p *FieldRanges) CheckOverlap(q *FieldRanges) error
CheckOverlap reports an error if p and q overlap.
func (*FieldRanges) CheckValid ¶
func (p *FieldRanges) CheckValid(isMessageSet bool) error
CheckValid reports any errors with the set of ranges with an error message that completes the sentence: "ranges is invalid because it has ..."
func (*FieldRanges) Get ¶
func (p *FieldRanges) Get(i int) [2]pref.FieldNumber
func (*FieldRanges) Has ¶
func (p *FieldRanges) Has(n pref.FieldNumber) bool
func (*FieldRanges) Len ¶
func (p *FieldRanges) Len() int
func (*FieldRanges) ProtoInternal ¶
func (p *FieldRanges) ProtoInternal(pragma.DoNotImplement)
type Fields ¶
type Fields struct { List []Field // contains filtered or unexported fields }
func (*Fields) ByJSONName ¶
func (p *Fields) ByJSONName(s string) protoreflect.FieldDescriptor
func (*Fields) ByName ¶
func (p *Fields) ByName(s protoreflect.Name) protoreflect.FieldDescriptor
func (*Fields) ByNumber ¶
func (p *Fields) ByNumber(n protoreflect.FieldNumber) protoreflect.FieldDescriptor
func (*Fields) ByTextName ¶
func (p *Fields) ByTextName(s string) protoreflect.FieldDescriptor
func (*Fields) Get ¶
func (p *Fields) Get(i int) protoreflect.FieldDescriptor
func (*Fields) ProtoInternal ¶
func (p *Fields) ProtoInternal(pragma.DoNotImplement)
type File ¶
func (*File) Enums ¶
func (fd *File) Enums() pref.EnumDescriptors
func (*File) Extensions ¶
func (fd *File) Extensions() pref.ExtensionDescriptors
func (*File) GoPackagePath ¶
GoPackagePath is a pseudo-internal API for determining the Go package path that this file descriptor is declared in.
WARNING: This method is exempt from the compatibility promise and may be removed in the future without warning.
func (*File) Imports ¶
func (fd *File) Imports() pref.FileImports
func (*File) IsPlaceholder ¶
func (*File) Messages ¶
func (fd *File) Messages() pref.MessageDescriptors
func (*File) Options ¶
func (fd *File) Options() pref.ProtoMessage
func (*File) Parent ¶
func (fd *File) Parent() pref.Descriptor
func (*File) ParentFile ¶
func (fd *File) ParentFile() pref.FileDescriptor
func (*File) ProtoInternal ¶
func (fd *File) ProtoInternal(pragma.DoNotImplement)
func (*File) ProtoType ¶
func (fd *File) ProtoType(pref.FileDescriptor)
func (*File) Services ¶
func (fd *File) Services() pref.ServiceDescriptors
func (*File) SourceLocations ¶
func (fd *File) SourceLocations() pref.SourceLocations
type FileImports ¶
type FileImports []pref.FileImport
func (*FileImports) Get ¶
func (p *FileImports) Get(i int) pref.FileImport
func (*FileImports) Len ¶
func (p *FileImports) Len() int
func (*FileImports) ProtoInternal ¶
func (p *FileImports) ProtoInternal(pragma.DoNotImplement)
type FileL2 ¶
type FileL2 struct { Options func() pref.ProtoMessage Imports FileImports Locations SourceLocations }
type Message ¶
func (*Message) Enums ¶
func (md *Message) Enums() pref.EnumDescriptors
func (*Message) ExtensionRangeOptions ¶
func (md *Message) ExtensionRangeOptions(i int) pref.ProtoMessage
func (*Message) ExtensionRanges ¶
func (md *Message) ExtensionRanges() pref.FieldRanges
func (*Message) Extensions ¶
func (md *Message) Extensions() pref.ExtensionDescriptors
func (*Message) Fields ¶
func (md *Message) Fields() pref.FieldDescriptors
func (*Message) IsMapEntry ¶
func (*Message) IsMessageSet ¶
IsMessageSet is a pseudo-internal API for checking whether a message should serialize in the proto1 message format.
WARNING: This method is exempt from the compatibility promise and may be removed in the future without warning.
func (*Message) Messages ¶
func (md *Message) Messages() pref.MessageDescriptors
func (*Message) Oneofs ¶
func (md *Message) Oneofs() pref.OneofDescriptors
func (*Message) Options ¶
func (md *Message) Options() pref.ProtoMessage
func (*Message) ProtoType ¶
func (md *Message) ProtoType(pref.MessageDescriptor)
func (*Message) RequiredNumbers ¶
func (md *Message) RequiredNumbers() pref.FieldNumbers
func (*Message) ReservedNames ¶
func (*Message) ReservedRanges ¶
func (md *Message) ReservedRanges() pref.FieldRanges
type MessageL1 ¶
type MessageL1 struct { Enums Enums Messages Messages Extensions Extensions IsMapEntry bool // promoted from google.protobuf.MessageOptions IsMessageSet bool // promoted from google.protobuf.MessageOptions }
type MessageL2 ¶
type MessageL2 struct { Options func() pref.ProtoMessage Fields Fields Oneofs Oneofs ReservedNames Names ReservedRanges FieldRanges RequiredNumbers FieldNumbers // must be consistent with Fields.Cardinality ExtensionRanges FieldRanges ExtensionRangeOptions []func() pref.ProtoMessage // must be same length as ExtensionRanges }
type Messages ¶
type Messages struct { List []Message // contains filtered or unexported fields }
func (*Messages) ByName ¶
func (p *Messages) ByName(s protoreflect.Name) protoreflect.MessageDescriptor
func (*Messages) Get ¶
func (p *Messages) Get(i int) protoreflect.MessageDescriptor
func (*Messages) ProtoInternal ¶
func (p *Messages) ProtoInternal(pragma.DoNotImplement)
type Method ¶
func (*Method) Input ¶
func (md *Method) Input() pref.MessageDescriptor
func (*Method) IsStreamingClient ¶
func (*Method) IsStreamingServer ¶
func (*Method) Options ¶
func (md *Method) Options() pref.ProtoMessage
func (*Method) Output ¶
func (md *Method) Output() pref.MessageDescriptor
func (*Method) ProtoInternal ¶
func (md *Method) ProtoInternal(pragma.DoNotImplement)
func (*Method) ProtoType ¶
func (md *Method) ProtoType(pref.MethodDescriptor)
type MethodL1 ¶
type MethodL1 struct { Options func() pref.ProtoMessage Input pref.MessageDescriptor Output pref.MessageDescriptor IsStreamingClient bool IsStreamingServer bool }
type Methods ¶
type Methods struct { List []Method // contains filtered or unexported fields }
func (*Methods) ByName ¶
func (p *Methods) ByName(s protoreflect.Name) protoreflect.MethodDescriptor
func (*Methods) Get ¶
func (p *Methods) Get(i int) protoreflect.MethodDescriptor
func (*Methods) ProtoInternal ¶
func (p *Methods) ProtoInternal(pragma.DoNotImplement)
type Names ¶
func (*Names) CheckValid ¶
CheckValid reports any errors with the set of names with an error message that completes the sentence: "ranges is invalid because it has ..."
func (*Names) ProtoInternal ¶
func (p *Names) ProtoInternal(pragma.DoNotImplement)
type Oneof ¶
func (*Oneof) Fields ¶
func (od *Oneof) Fields() pref.FieldDescriptors
func (*Oneof) IsSynthetic ¶
func (*Oneof) Options ¶
func (od *Oneof) Options() pref.ProtoMessage
func (*Oneof) ProtoType ¶
func (od *Oneof) ProtoType(pref.OneofDescriptor)
type OneofFields ¶
type OneofFields struct { List []pref.FieldDescriptor // contains filtered or unexported fields }
func (*OneofFields) ByJSONName ¶
func (p *OneofFields) ByJSONName(s string) pref.FieldDescriptor
func (*OneofFields) ByName ¶
func (p *OneofFields) ByName(s pref.Name) pref.FieldDescriptor
func (*OneofFields) ByNumber ¶
func (p *OneofFields) ByNumber(n pref.FieldNumber) pref.FieldDescriptor
func (*OneofFields) ByTextName ¶
func (p *OneofFields) ByTextName(s string) pref.FieldDescriptor
func (*OneofFields) Get ¶
func (p *OneofFields) Get(i int) pref.FieldDescriptor
func (*OneofFields) Len ¶
func (p *OneofFields) Len() int
func (*OneofFields) ProtoInternal ¶
func (p *OneofFields) ProtoInternal(pragma.DoNotImplement)
type OneofL1 ¶
type OneofL1 struct { Options func() pref.ProtoMessage Fields OneofFields // must be consistent with Message.Fields.ContainingOneof }
type Oneofs ¶
type Oneofs struct { List []Oneof // contains filtered or unexported fields }
func (*Oneofs) ByName ¶
func (p *Oneofs) ByName(s protoreflect.Name) protoreflect.OneofDescriptor
func (*Oneofs) Get ¶
func (p *Oneofs) Get(i int) protoreflect.OneofDescriptor
func (*Oneofs) ProtoInternal ¶
func (p *Oneofs) ProtoInternal(pragma.DoNotImplement)
type Out ¶
type Out struct { File pref.FileDescriptor // Enums is all enum descriptors in "flattened ordering". Enums []Enum // Messages is all message descriptors in "flattened ordering". // It includes the implicit message declarations for map entries. Messages []Message // Extensions is all extension descriptors in "flattened ordering". Extensions []Extension // Service is all service descriptors in "flattened ordering". Services []Service }
Out is the output of the Builder.
type PlaceholderEnum ¶
PlaceholderEnum is a placeholder, representing only the full name.
func (PlaceholderEnum) FullName ¶
func (e PlaceholderEnum) FullName() pref.FullName
func (PlaceholderEnum) Index ¶
func (e PlaceholderEnum) Index() int
func (PlaceholderEnum) IsPlaceholder ¶
func (e PlaceholderEnum) IsPlaceholder() bool
func (PlaceholderEnum) Name ¶
func (e PlaceholderEnum) Name() pref.Name
func (PlaceholderEnum) Options ¶
func (e PlaceholderEnum) Options() pref.ProtoMessage
func (PlaceholderEnum) Parent ¶
func (e PlaceholderEnum) Parent() pref.Descriptor
func (PlaceholderEnum) ParentFile ¶
func (e PlaceholderEnum) ParentFile() pref.FileDescriptor
func (PlaceholderEnum) ProtoInternal ¶
func (e PlaceholderEnum) ProtoInternal(pragma.DoNotImplement)
func (PlaceholderEnum) ProtoType ¶
func (e PlaceholderEnum) ProtoType(pref.EnumDescriptor)
func (PlaceholderEnum) ReservedNames ¶
func (e PlaceholderEnum) ReservedNames() pref.Names
func (PlaceholderEnum) ReservedRanges ¶
func (e PlaceholderEnum) ReservedRanges() pref.EnumRanges
func (PlaceholderEnum) Syntax ¶
func (e PlaceholderEnum) Syntax() pref.Syntax
func (PlaceholderEnum) Values ¶
func (e PlaceholderEnum) Values() pref.EnumValueDescriptors
type PlaceholderEnumValue ¶
PlaceholderEnumValue is a placeholder, representing only the full name.
func (PlaceholderEnumValue) FullName ¶
func (e PlaceholderEnumValue) FullName() pref.FullName
func (PlaceholderEnumValue) Index ¶
func (e PlaceholderEnumValue) Index() int
func (PlaceholderEnumValue) IsPlaceholder ¶
func (e PlaceholderEnumValue) IsPlaceholder() bool
func (PlaceholderEnumValue) Name ¶
func (e PlaceholderEnumValue) Name() pref.Name
func (PlaceholderEnumValue) Number ¶
func (e PlaceholderEnumValue) Number() pref.EnumNumber
func (PlaceholderEnumValue) Options ¶
func (e PlaceholderEnumValue) Options() pref.ProtoMessage
func (PlaceholderEnumValue) Parent ¶
func (e PlaceholderEnumValue) Parent() pref.Descriptor
func (PlaceholderEnumValue) ParentFile ¶
func (e PlaceholderEnumValue) ParentFile() pref.FileDescriptor
func (PlaceholderEnumValue) ProtoInternal ¶
func (e PlaceholderEnumValue) ProtoInternal(pragma.DoNotImplement)
func (PlaceholderEnumValue) ProtoType ¶
func (e PlaceholderEnumValue) ProtoType(pref.EnumValueDescriptor)
func (PlaceholderEnumValue) Syntax ¶
func (e PlaceholderEnumValue) Syntax() pref.Syntax
type PlaceholderFile ¶
type PlaceholderFile string
PlaceholderFile is a placeholder, representing only the file path.
func (PlaceholderFile) Enums ¶
func (f PlaceholderFile) Enums() pref.EnumDescriptors
func (PlaceholderFile) Extensions ¶
func (f PlaceholderFile) Extensions() pref.ExtensionDescriptors
func (PlaceholderFile) FullName ¶
func (f PlaceholderFile) FullName() pref.FullName
func (PlaceholderFile) Imports ¶
func (f PlaceholderFile) Imports() pref.FileImports
func (PlaceholderFile) Index ¶
func (f PlaceholderFile) Index() int
func (PlaceholderFile) IsPlaceholder ¶
func (f PlaceholderFile) IsPlaceholder() bool
func (PlaceholderFile) Messages ¶
func (f PlaceholderFile) Messages() pref.MessageDescriptors
func (PlaceholderFile) Name ¶
func (f PlaceholderFile) Name() pref.Name
func (PlaceholderFile) Options ¶
func (f PlaceholderFile) Options() pref.ProtoMessage
func (PlaceholderFile) Package ¶
func (f PlaceholderFile) Package() pref.FullName
func (PlaceholderFile) Parent ¶
func (f PlaceholderFile) Parent() pref.Descriptor
func (PlaceholderFile) ParentFile ¶
func (f PlaceholderFile) ParentFile() pref.FileDescriptor
func (PlaceholderFile) Path ¶
func (f PlaceholderFile) Path() string
func (PlaceholderFile) ProtoInternal ¶
func (f PlaceholderFile) ProtoInternal(pragma.DoNotImplement)
func (PlaceholderFile) ProtoType ¶
func (f PlaceholderFile) ProtoType(pref.FileDescriptor)
func (PlaceholderFile) Services ¶
func (f PlaceholderFile) Services() pref.ServiceDescriptors
func (PlaceholderFile) SourceLocations ¶
func (f PlaceholderFile) SourceLocations() pref.SourceLocations
func (PlaceholderFile) Syntax ¶
func (f PlaceholderFile) Syntax() pref.Syntax
type PlaceholderMessage ¶
PlaceholderMessage is a placeholder, representing only the full name.
func (PlaceholderMessage) Enums ¶
func (m PlaceholderMessage) Enums() pref.EnumDescriptors
func (PlaceholderMessage) ExtensionRangeOptions ¶
func (m PlaceholderMessage) ExtensionRangeOptions(int) pref.ProtoMessage
func (PlaceholderMessage) ExtensionRanges ¶
func (m PlaceholderMessage) ExtensionRanges() pref.FieldRanges
func (PlaceholderMessage) Extensions ¶
func (m PlaceholderMessage) Extensions() pref.ExtensionDescriptors
func (PlaceholderMessage) Fields ¶
func (m PlaceholderMessage) Fields() pref.FieldDescriptors
func (PlaceholderMessage) FullName ¶
func (m PlaceholderMessage) FullName() pref.FullName
func (PlaceholderMessage) Index ¶
func (m PlaceholderMessage) Index() int
func (PlaceholderMessage) IsMapEntry ¶
func (m PlaceholderMessage) IsMapEntry() bool
func (PlaceholderMessage) IsPlaceholder ¶
func (m PlaceholderMessage) IsPlaceholder() bool
func (PlaceholderMessage) Messages ¶
func (m PlaceholderMessage) Messages() pref.MessageDescriptors
func (PlaceholderMessage) Name ¶
func (m PlaceholderMessage) Name() pref.Name
func (PlaceholderMessage) Oneofs ¶
func (m PlaceholderMessage) Oneofs() pref.OneofDescriptors
func (PlaceholderMessage) Options ¶
func (m PlaceholderMessage) Options() pref.ProtoMessage
func (PlaceholderMessage) Parent ¶
func (m PlaceholderMessage) Parent() pref.Descriptor
func (PlaceholderMessage) ParentFile ¶
func (m PlaceholderMessage) ParentFile() pref.FileDescriptor
func (PlaceholderMessage) ProtoInternal ¶
func (m PlaceholderMessage) ProtoInternal(pragma.DoNotImplement)
func (PlaceholderMessage) ProtoType ¶
func (m PlaceholderMessage) ProtoType(pref.MessageDescriptor)
func (PlaceholderMessage) RequiredNumbers ¶
func (m PlaceholderMessage) RequiredNumbers() pref.FieldNumbers
func (PlaceholderMessage) ReservedNames ¶
func (m PlaceholderMessage) ReservedNames() pref.Names
func (PlaceholderMessage) ReservedRanges ¶
func (m PlaceholderMessage) ReservedRanges() pref.FieldRanges
func (PlaceholderMessage) Syntax ¶
func (m PlaceholderMessage) Syntax() pref.Syntax
type Service ¶
func (*Service) Methods ¶
func (sd *Service) Methods() pref.MethodDescriptors
func (*Service) Options ¶
func (sd *Service) Options() pref.ProtoMessage
func (*Service) ProtoInternal ¶
func (sd *Service) ProtoInternal(pragma.DoNotImplement)
func (*Service) ProtoType ¶
func (sd *Service) ProtoType(pref.ServiceDescriptor)
type ServiceL2 ¶
type ServiceL2 struct { Options func() pref.ProtoMessage Methods Methods }
type Services ¶
type Services struct { List []Service // contains filtered or unexported fields }
func (*Services) ByName ¶
func (p *Services) ByName(s protoreflect.Name) protoreflect.ServiceDescriptor
func (*Services) Get ¶
func (p *Services) Get(i int) protoreflect.ServiceDescriptor
func (*Services) ProtoInternal ¶
func (p *Services) ProtoInternal(pragma.DoNotImplement)
type SourceLocations ¶
type SourceLocations struct { // List is a list of SourceLocations. // The SourceLocation.Next field does not need to be populated // as it will be lazily populated upon first need. List []pref.SourceLocation // File is the parent file descriptor that these locations are relative to. // If non-nil, ByDescriptor verifies that the provided descriptor // is a child of this file descriptor. File pref.FileDescriptor // contains filtered or unexported fields }
func (*SourceLocations) ByDescriptor ¶
func (p *SourceLocations) ByDescriptor(desc pref.Descriptor) pref.SourceLocation
func (*SourceLocations) ByPath ¶
func (p *SourceLocations) ByPath(path pref.SourcePath) pref.SourceLocation
func (*SourceLocations) Get ¶
func (p *SourceLocations) Get(i int) pref.SourceLocation
func (*SourceLocations) Len ¶
func (p *SourceLocations) Len() int
func (*SourceLocations) ProtoInternal ¶
func (p *SourceLocations) ProtoInternal(pragma.DoNotImplement)