mirror of
https://github.com/protocolbuffers/protobuf-go.git
synced 2025-03-09 22:13:27 +00:00
reflect/protoreflect: remove DescriptorProto method
The DescriptorProto method was originally intended to return a raw descriptor. However, that functionality will be responsibility of the protodesc package in the near future. Also document that any callers of Options must import the descriptor package. This is reasonable since any usage of that method will almost always be of the form: fd.Options().(*descriptorpb.FieldOptions) Change-Id: I1085f02305faef8dd724e0cb3ad45ac12bd5df0a Reviewed-on: https://go-review.googlesource.com/c/153497 Reviewed-by: Damien Neil <dneil@google.com>
This commit is contained in:
parent
97e7f57dbb
commit
2653420232
@ -80,32 +80,6 @@ type Descriptor interface {
|
||||
// For FileDescriptor, the Path and Package are also valid.
|
||||
IsPlaceholder() bool
|
||||
|
||||
// DescriptorProto returns a reflective interface to the underlying
|
||||
// google.protobuf.XXXDescriptorProto message. The returned Message is
|
||||
// considered frozen and mutating operations must not be performed
|
||||
// on the message or any nested values retrieved by methods on the message.
|
||||
//
|
||||
// The proto message type for each type is as follows:
|
||||
// +---------------------+------------------------------------------+
|
||||
// | Go type | Proto message type |
|
||||
// +---------------------+------------------------------------------+
|
||||
// | FileDescriptor | google.protobuf.FileDescriptorProto |
|
||||
// | MessageDescriptor | google.protobuf.DescriptorProto |
|
||||
// | FieldDescriptor | google.protobuf.FieldDescriptorProto |
|
||||
// | OneofDescriptor | google.protobuf.OneofDescriptorProto |
|
||||
// | EnumDescriptor | google.protobuf.EnumDescriptorProto |
|
||||
// | EnumValueDescriptor | google.protobuf.EnumValueDescriptorProto |
|
||||
// | ServiceDescriptor | google.protobuf.ServiceDescriptorProto |
|
||||
// | MethodDescriptor | google.protobuf.MethodDescriptorProto |
|
||||
// +---------------------+------------------------------------------+
|
||||
//
|
||||
// Support for this functionality is optional and may return (nil, false).
|
||||
DescriptorProto() (Message, bool)
|
||||
|
||||
// TODO: Should DescriptorProto exist if prototype does not depend on
|
||||
// the descriptor package? Should this instead be a function in the
|
||||
// protodesc package?
|
||||
|
||||
// Options returns the descriptor options. The caller must not modify
|
||||
// the returned value.
|
||||
//
|
||||
@ -124,17 +98,10 @@ type Descriptor interface {
|
||||
// | MethodDescriptor | google.protobuf.MethodOptions |
|
||||
// +---------------------+------------------------------------------+
|
||||
//
|
||||
// This method may return a nil interface value if no options are present.
|
||||
// This method returns a typed nil-pointer if no options are present.
|
||||
// The caller must import the descriptor package to use this.
|
||||
Options() ProtoMessage
|
||||
|
||||
// TODO: If no options are set, can Options return a typed nil-pointer
|
||||
// using a form of dependency injection where the descriptor proto
|
||||
// registers the option types with the prototype package?
|
||||
//
|
||||
// However, what happens if the descriptor proto is never linked in?
|
||||
// Then we cannot provide this guarantee.
|
||||
// Perhaps this should return a bool as well?
|
||||
|
||||
doNotImplement
|
||||
}
|
||||
|
||||
|
@ -29,14 +29,13 @@ var (
|
||||
|
||||
type placeholderName pref.FullName
|
||||
|
||||
func (t placeholderName) Parent() (pref.Descriptor, bool) { return nil, false }
|
||||
func (t placeholderName) Index() int { return 0 }
|
||||
func (t placeholderName) Syntax() pref.Syntax { return 0 }
|
||||
func (t placeholderName) Name() pref.Name { return pref.FullName(t).Name() }
|
||||
func (t placeholderName) FullName() pref.FullName { return pref.FullName(t) }
|
||||
func (t placeholderName) IsPlaceholder() bool { return true }
|
||||
func (t placeholderName) DescriptorProto() (pref.Message, bool) { return nil, false }
|
||||
func (t placeholderName) ProtoInternal(pragma.DoNotImplement) {}
|
||||
func (t placeholderName) Parent() (pref.Descriptor, bool) { return nil, false }
|
||||
func (t placeholderName) Index() int { return 0 }
|
||||
func (t placeholderName) Syntax() pref.Syntax { return 0 }
|
||||
func (t placeholderName) Name() pref.Name { return pref.FullName(t).Name() }
|
||||
func (t placeholderName) FullName() pref.FullName { return pref.FullName(t) }
|
||||
func (t placeholderName) IsPlaceholder() bool { return true }
|
||||
func (t placeholderName) ProtoInternal(pragma.DoNotImplement) {}
|
||||
|
||||
type placeholderFile struct {
|
||||
path string
|
||||
|
@ -68,7 +68,6 @@ func (t fileDesc) Syntax() pref.Syntax { return t.f
|
||||
func (t fileDesc) Name() pref.Name { return t.f.Package.Name() }
|
||||
func (t fileDesc) FullName() pref.FullName { return t.f.Package }
|
||||
func (t fileDesc) IsPlaceholder() bool { return false }
|
||||
func (t fileDesc) DescriptorProto() (pref.Message, bool) { return nil, false }
|
||||
func (t fileDesc) Options() pref.ProtoMessage { return altOptions(t.f.Options, optionTypes.File) }
|
||||
func (t fileDesc) Path() string { return t.f.Path }
|
||||
func (t fileDesc) Package() pref.FullName { return t.f.Package }
|
||||
@ -170,21 +169,20 @@ type messageMeta struct {
|
||||
}
|
||||
type messageDesc struct{ m *Message }
|
||||
|
||||
func (t messageDesc) Parent() (pref.Descriptor, bool) { return t.m.parent, true }
|
||||
func (t messageDesc) Index() int { return t.m.index }
|
||||
func (t messageDesc) Syntax() pref.Syntax { return t.m.syntax }
|
||||
func (t messageDesc) Name() pref.Name { return t.m.Name }
|
||||
func (t messageDesc) FullName() pref.FullName { return t.m.fullName }
|
||||
func (t messageDesc) IsPlaceholder() bool { return false }
|
||||
func (t messageDesc) DescriptorProto() (pref.Message, bool) { return nil, false }
|
||||
func (t messageDesc) Options() pref.ProtoMessage { return altOptions(t.m.Options, optionTypes.Message) }
|
||||
func (t messageDesc) IsMapEntry() bool { return t.m.mo.lazyInit(t).isMapEntry }
|
||||
func (t messageDesc) Fields() pref.FieldDescriptors { return t.m.fs.lazyInit(t, t.m.Fields) }
|
||||
func (t messageDesc) Oneofs() pref.OneofDescriptors { return t.m.os.lazyInit(t, t.m.Oneofs) }
|
||||
func (t messageDesc) ReservedNames() pref.Names { return (*names)(&t.m.ReservedNames) }
|
||||
func (t messageDesc) ReservedRanges() pref.FieldRanges { return (*fieldRanges)(&t.m.ReservedRanges) }
|
||||
func (t messageDesc) RequiredNumbers() pref.FieldNumbers { return t.m.ns.lazyInit(t.m.Fields) }
|
||||
func (t messageDesc) ExtensionRanges() pref.FieldRanges { return (*fieldRanges)(&t.m.ExtensionRanges) }
|
||||
func (t messageDesc) Parent() (pref.Descriptor, bool) { return t.m.parent, true }
|
||||
func (t messageDesc) Index() int { return t.m.index }
|
||||
func (t messageDesc) Syntax() pref.Syntax { return t.m.syntax }
|
||||
func (t messageDesc) Name() pref.Name { return t.m.Name }
|
||||
func (t messageDesc) FullName() pref.FullName { return t.m.fullName }
|
||||
func (t messageDesc) IsPlaceholder() bool { return false }
|
||||
func (t messageDesc) Options() pref.ProtoMessage { return altOptions(t.m.Options, optionTypes.Message) }
|
||||
func (t messageDesc) IsMapEntry() bool { return t.m.mo.lazyInit(t).isMapEntry }
|
||||
func (t messageDesc) Fields() pref.FieldDescriptors { return t.m.fs.lazyInit(t, t.m.Fields) }
|
||||
func (t messageDesc) Oneofs() pref.OneofDescriptors { return t.m.os.lazyInit(t, t.m.Oneofs) }
|
||||
func (t messageDesc) ReservedNames() pref.Names { return (*names)(&t.m.ReservedNames) }
|
||||
func (t messageDesc) ReservedRanges() pref.FieldRanges { return (*fieldRanges)(&t.m.ReservedRanges) }
|
||||
func (t messageDesc) RequiredNumbers() pref.FieldNumbers { return t.m.ns.lazyInit(t.m.Fields) }
|
||||
func (t messageDesc) ExtensionRanges() pref.FieldRanges { return (*fieldRanges)(&t.m.ExtensionRanges) }
|
||||
func (t messageDesc) ExtensionRangeOptions(i int) pref.ProtoMessage {
|
||||
return extensionRangeOptions(i, len(t.m.ExtensionRanges), t.m.ExtensionRangeOptions)
|
||||
}
|
||||
@ -243,7 +241,6 @@ func (t fieldDesc) Syntax() pref.Syntax { return t.f.synt
|
||||
func (t fieldDesc) Name() pref.Name { return t.f.Name }
|
||||
func (t fieldDesc) FullName() pref.FullName { return t.f.fullName }
|
||||
func (t fieldDesc) IsPlaceholder() bool { return false }
|
||||
func (t fieldDesc) DescriptorProto() (pref.Message, bool) { return nil, false }
|
||||
func (t fieldDesc) Options() pref.ProtoMessage { return altOptions(t.f.Options, optionTypes.Field) }
|
||||
func (t fieldDesc) Number() pref.FieldNumber { return t.f.Number }
|
||||
func (t fieldDesc) Cardinality() pref.Cardinality { return t.f.Cardinality }
|
||||
@ -391,18 +388,17 @@ type oneofMeta struct {
|
||||
}
|
||||
type oneofDesc struct{ o *Oneof }
|
||||
|
||||
func (t oneofDesc) Parent() (pref.Descriptor, bool) { return t.o.parent, true }
|
||||
func (t oneofDesc) Index() int { return t.o.index }
|
||||
func (t oneofDesc) Syntax() pref.Syntax { return t.o.syntax }
|
||||
func (t oneofDesc) Name() pref.Name { return t.o.Name }
|
||||
func (t oneofDesc) FullName() pref.FullName { return t.o.fullName }
|
||||
func (t oneofDesc) IsPlaceholder() bool { return false }
|
||||
func (t oneofDesc) DescriptorProto() (pref.Message, bool) { return nil, false }
|
||||
func (t oneofDesc) Options() pref.ProtoMessage { return altOptions(t.o.Options, optionTypes.Oneof) }
|
||||
func (t oneofDesc) Fields() pref.FieldDescriptors { return t.o.fs.lazyInit(t) }
|
||||
func (t oneofDesc) Format(s fmt.State, r rune) { pfmt.FormatDesc(s, r, t) }
|
||||
func (t oneofDesc) ProtoType(pref.OneofDescriptor) {}
|
||||
func (t oneofDesc) ProtoInternal(pragma.DoNotImplement) {}
|
||||
func (t oneofDesc) Parent() (pref.Descriptor, bool) { return t.o.parent, true }
|
||||
func (t oneofDesc) Index() int { return t.o.index }
|
||||
func (t oneofDesc) Syntax() pref.Syntax { return t.o.syntax }
|
||||
func (t oneofDesc) Name() pref.Name { return t.o.Name }
|
||||
func (t oneofDesc) FullName() pref.FullName { return t.o.fullName }
|
||||
func (t oneofDesc) IsPlaceholder() bool { return false }
|
||||
func (t oneofDesc) Options() pref.ProtoMessage { return altOptions(t.o.Options, optionTypes.Oneof) }
|
||||
func (t oneofDesc) Fields() pref.FieldDescriptors { return t.o.fs.lazyInit(t) }
|
||||
func (t oneofDesc) Format(s fmt.State, r rune) { pfmt.FormatDesc(s, r, t) }
|
||||
func (t oneofDesc) ProtoType(pref.OneofDescriptor) {}
|
||||
func (t oneofDesc) ProtoInternal(pragma.DoNotImplement) {}
|
||||
|
||||
type extensionMeta struct {
|
||||
inheritedMeta
|
||||
@ -420,7 +416,6 @@ func (t extensionDesc) Index() int { return t.x.
|
||||
func (t extensionDesc) Name() pref.Name { return t.x.Name }
|
||||
func (t extensionDesc) FullName() pref.FullName { return t.x.fullName }
|
||||
func (t extensionDesc) IsPlaceholder() bool { return false }
|
||||
func (t extensionDesc) DescriptorProto() (pref.Message, bool) { return nil, false }
|
||||
func (t extensionDesc) Options() pref.ProtoMessage { return altOptions(t.x.Options, optionTypes.Field) }
|
||||
func (t extensionDesc) Number() pref.FieldNumber { return t.x.Number }
|
||||
func (t extensionDesc) Cardinality() pref.Cardinality { return t.x.Cardinality }
|
||||
@ -452,33 +447,31 @@ type enumMeta struct {
|
||||
}
|
||||
type enumDesc struct{ e *Enum }
|
||||
|
||||
func (t enumDesc) Parent() (pref.Descriptor, bool) { return t.e.parent, true }
|
||||
func (t enumDesc) Index() int { return t.e.index }
|
||||
func (t enumDesc) Syntax() pref.Syntax { return t.e.syntax }
|
||||
func (t enumDesc) Name() pref.Name { return t.e.Name }
|
||||
func (t enumDesc) FullName() pref.FullName { return t.e.fullName }
|
||||
func (t enumDesc) IsPlaceholder() bool { return false }
|
||||
func (t enumDesc) DescriptorProto() (pref.Message, bool) { return nil, false }
|
||||
func (t enumDesc) Options() pref.ProtoMessage { return altOptions(t.e.Options, optionTypes.Enum) }
|
||||
func (t enumDesc) Values() pref.EnumValueDescriptors { return t.e.vs.lazyInit(t, t.e.Values) }
|
||||
func (t enumDesc) ReservedNames() pref.Names { return (*names)(&t.e.ReservedNames) }
|
||||
func (t enumDesc) ReservedRanges() pref.EnumRanges { return (*enumRanges)(&t.e.ReservedRanges) }
|
||||
func (t enumDesc) Format(s fmt.State, r rune) { pfmt.FormatDesc(s, r, t) }
|
||||
func (t enumDesc) ProtoType(pref.EnumDescriptor) {}
|
||||
func (t enumDesc) ProtoInternal(pragma.DoNotImplement) {}
|
||||
func (t enumDesc) Parent() (pref.Descriptor, bool) { return t.e.parent, true }
|
||||
func (t enumDesc) Index() int { return t.e.index }
|
||||
func (t enumDesc) Syntax() pref.Syntax { return t.e.syntax }
|
||||
func (t enumDesc) Name() pref.Name { return t.e.Name }
|
||||
func (t enumDesc) FullName() pref.FullName { return t.e.fullName }
|
||||
func (t enumDesc) IsPlaceholder() bool { return false }
|
||||
func (t enumDesc) Options() pref.ProtoMessage { return altOptions(t.e.Options, optionTypes.Enum) }
|
||||
func (t enumDesc) Values() pref.EnumValueDescriptors { return t.e.vs.lazyInit(t, t.e.Values) }
|
||||
func (t enumDesc) ReservedNames() pref.Names { return (*names)(&t.e.ReservedNames) }
|
||||
func (t enumDesc) ReservedRanges() pref.EnumRanges { return (*enumRanges)(&t.e.ReservedRanges) }
|
||||
func (t enumDesc) Format(s fmt.State, r rune) { pfmt.FormatDesc(s, r, t) }
|
||||
func (t enumDesc) ProtoType(pref.EnumDescriptor) {}
|
||||
func (t enumDesc) ProtoInternal(pragma.DoNotImplement) {}
|
||||
|
||||
type enumValueMeta struct {
|
||||
inheritedMeta
|
||||
}
|
||||
type enumValueDesc struct{ v *EnumValue }
|
||||
|
||||
func (t enumValueDesc) Parent() (pref.Descriptor, bool) { return t.v.parent, true }
|
||||
func (t enumValueDesc) Index() int { return t.v.index }
|
||||
func (t enumValueDesc) Syntax() pref.Syntax { return t.v.syntax }
|
||||
func (t enumValueDesc) Name() pref.Name { return t.v.Name }
|
||||
func (t enumValueDesc) FullName() pref.FullName { return t.v.fullName }
|
||||
func (t enumValueDesc) IsPlaceholder() bool { return false }
|
||||
func (t enumValueDesc) DescriptorProto() (pref.Message, bool) { return nil, false }
|
||||
func (t enumValueDesc) Parent() (pref.Descriptor, bool) { return t.v.parent, true }
|
||||
func (t enumValueDesc) Index() int { return t.v.index }
|
||||
func (t enumValueDesc) Syntax() pref.Syntax { return t.v.syntax }
|
||||
func (t enumValueDesc) Name() pref.Name { return t.v.Name }
|
||||
func (t enumValueDesc) FullName() pref.FullName { return t.v.fullName }
|
||||
func (t enumValueDesc) IsPlaceholder() bool { return false }
|
||||
func (t enumValueDesc) Options() pref.ProtoMessage {
|
||||
return altOptions(t.v.Options, optionTypes.EnumValue)
|
||||
}
|
||||
@ -494,18 +487,17 @@ type serviceMeta struct {
|
||||
}
|
||||
type serviceDesc struct{ s *Service }
|
||||
|
||||
func (t serviceDesc) Parent() (pref.Descriptor, bool) { return t.s.parent, true }
|
||||
func (t serviceDesc) Index() int { return t.s.index }
|
||||
func (t serviceDesc) Syntax() pref.Syntax { return t.s.syntax }
|
||||
func (t serviceDesc) Name() pref.Name { return t.s.Name }
|
||||
func (t serviceDesc) FullName() pref.FullName { return t.s.fullName }
|
||||
func (t serviceDesc) IsPlaceholder() bool { return false }
|
||||
func (t serviceDesc) DescriptorProto() (pref.Message, bool) { return nil, false }
|
||||
func (t serviceDesc) Options() pref.ProtoMessage { return altOptions(t.s.Options, optionTypes.Service) }
|
||||
func (t serviceDesc) Methods() pref.MethodDescriptors { return t.s.ms.lazyInit(t, t.s.Methods) }
|
||||
func (t serviceDesc) Format(s fmt.State, r rune) { pfmt.FormatDesc(s, r, t) }
|
||||
func (t serviceDesc) ProtoType(pref.ServiceDescriptor) {}
|
||||
func (t serviceDesc) ProtoInternal(pragma.DoNotImplement) {}
|
||||
func (t serviceDesc) Parent() (pref.Descriptor, bool) { return t.s.parent, true }
|
||||
func (t serviceDesc) Index() int { return t.s.index }
|
||||
func (t serviceDesc) Syntax() pref.Syntax { return t.s.syntax }
|
||||
func (t serviceDesc) Name() pref.Name { return t.s.Name }
|
||||
func (t serviceDesc) FullName() pref.FullName { return t.s.fullName }
|
||||
func (t serviceDesc) IsPlaceholder() bool { return false }
|
||||
func (t serviceDesc) Options() pref.ProtoMessage { return altOptions(t.s.Options, optionTypes.Service) }
|
||||
func (t serviceDesc) Methods() pref.MethodDescriptors { return t.s.ms.lazyInit(t, t.s.Methods) }
|
||||
func (t serviceDesc) Format(s fmt.State, r rune) { pfmt.FormatDesc(s, r, t) }
|
||||
func (t serviceDesc) ProtoType(pref.ServiceDescriptor) {}
|
||||
func (t serviceDesc) ProtoInternal(pragma.DoNotImplement) {}
|
||||
|
||||
type methodMeta struct {
|
||||
inheritedMeta
|
||||
@ -515,21 +507,20 @@ type methodMeta struct {
|
||||
}
|
||||
type methodDesc struct{ m *Method }
|
||||
|
||||
func (t methodDesc) Parent() (pref.Descriptor, bool) { return t.m.parent, true }
|
||||
func (t methodDesc) Index() int { return t.m.index }
|
||||
func (t methodDesc) Syntax() pref.Syntax { return t.m.syntax }
|
||||
func (t methodDesc) Name() pref.Name { return t.m.Name }
|
||||
func (t methodDesc) FullName() pref.FullName { return t.m.fullName }
|
||||
func (t methodDesc) IsPlaceholder() bool { return false }
|
||||
func (t methodDesc) DescriptorProto() (pref.Message, bool) { return nil, false }
|
||||
func (t methodDesc) Options() pref.ProtoMessage { return altOptions(t.m.Options, optionTypes.Method) }
|
||||
func (t methodDesc) InputType() pref.MessageDescriptor { return t.m.mit.lazyInit(t, &t.m.InputType) }
|
||||
func (t methodDesc) OutputType() pref.MessageDescriptor { return t.m.mot.lazyInit(t, &t.m.OutputType) }
|
||||
func (t methodDesc) IsStreamingClient() bool { return t.m.IsStreamingClient }
|
||||
func (t methodDesc) IsStreamingServer() bool { return t.m.IsStreamingServer }
|
||||
func (t methodDesc) Format(s fmt.State, r rune) { pfmt.FormatDesc(s, r, t) }
|
||||
func (t methodDesc) ProtoType(pref.MethodDescriptor) {}
|
||||
func (t methodDesc) ProtoInternal(pragma.DoNotImplement) {}
|
||||
func (t methodDesc) Parent() (pref.Descriptor, bool) { return t.m.parent, true }
|
||||
func (t methodDesc) Index() int { return t.m.index }
|
||||
func (t methodDesc) Syntax() pref.Syntax { return t.m.syntax }
|
||||
func (t methodDesc) Name() pref.Name { return t.m.Name }
|
||||
func (t methodDesc) FullName() pref.FullName { return t.m.fullName }
|
||||
func (t methodDesc) IsPlaceholder() bool { return false }
|
||||
func (t methodDesc) Options() pref.ProtoMessage { return altOptions(t.m.Options, optionTypes.Method) }
|
||||
func (t methodDesc) InputType() pref.MessageDescriptor { return t.m.mit.lazyInit(t, &t.m.InputType) }
|
||||
func (t methodDesc) OutputType() pref.MessageDescriptor { return t.m.mot.lazyInit(t, &t.m.OutputType) }
|
||||
func (t methodDesc) IsStreamingClient() bool { return t.m.IsStreamingClient }
|
||||
func (t methodDesc) IsStreamingServer() bool { return t.m.IsStreamingServer }
|
||||
func (t methodDesc) Format(s fmt.State, r rune) { pfmt.FormatDesc(s, r, t) }
|
||||
func (t methodDesc) ProtoType(pref.MethodDescriptor) {}
|
||||
func (t methodDesc) ProtoInternal(pragma.DoNotImplement) {}
|
||||
|
||||
type defaultValue struct {
|
||||
once sync.Once
|
||||
|
@ -14,13 +14,12 @@ import (
|
||||
|
||||
type standaloneMessage struct{ m *StandaloneMessage }
|
||||
|
||||
func (t standaloneMessage) Parent() (pref.Descriptor, bool) { return nil, false }
|
||||
func (t standaloneMessage) Index() int { return 0 }
|
||||
func (t standaloneMessage) Syntax() pref.Syntax { return t.m.Syntax }
|
||||
func (t standaloneMessage) Name() pref.Name { return t.m.FullName.Name() }
|
||||
func (t standaloneMessage) FullName() pref.FullName { return t.m.FullName }
|
||||
func (t standaloneMessage) IsPlaceholder() bool { return false }
|
||||
func (t standaloneMessage) DescriptorProto() (pref.Message, bool) { return nil, false }
|
||||
func (t standaloneMessage) Parent() (pref.Descriptor, bool) { return nil, false }
|
||||
func (t standaloneMessage) Index() int { return 0 }
|
||||
func (t standaloneMessage) Syntax() pref.Syntax { return t.m.Syntax }
|
||||
func (t standaloneMessage) Name() pref.Name { return t.m.FullName.Name() }
|
||||
func (t standaloneMessage) FullName() pref.FullName { return t.m.FullName }
|
||||
func (t standaloneMessage) IsPlaceholder() bool { return false }
|
||||
func (t standaloneMessage) Options() pref.ProtoMessage {
|
||||
return altOptions(t.m.Options, optionTypes.Message)
|
||||
}
|
||||
@ -47,30 +46,28 @@ func (t standaloneMessage) ProtoInternal(pragma.DoNotImplement) {}
|
||||
|
||||
type standaloneEnum struct{ e *StandaloneEnum }
|
||||
|
||||
func (t standaloneEnum) Parent() (pref.Descriptor, bool) { return nil, false }
|
||||
func (t standaloneEnum) Index() int { return 0 }
|
||||
func (t standaloneEnum) Syntax() pref.Syntax { return t.e.Syntax }
|
||||
func (t standaloneEnum) Name() pref.Name { return t.e.FullName.Name() }
|
||||
func (t standaloneEnum) FullName() pref.FullName { return t.e.FullName }
|
||||
func (t standaloneEnum) IsPlaceholder() bool { return false }
|
||||
func (t standaloneEnum) DescriptorProto() (pref.Message, bool) { return nil, false }
|
||||
func (t standaloneEnum) Options() pref.ProtoMessage { return altOptions(t.e.Options, optionTypes.Enum) }
|
||||
func (t standaloneEnum) Values() pref.EnumValueDescriptors { return t.e.vals.lazyInit(t, t.e.Values) }
|
||||
func (t standaloneEnum) ReservedNames() pref.Names { return (*names)(&t.e.ReservedNames) }
|
||||
func (t standaloneEnum) ReservedRanges() pref.EnumRanges { return (*enumRanges)(&t.e.ReservedRanges) }
|
||||
func (t standaloneEnum) Format(s fmt.State, r rune) { pfmt.FormatDesc(s, r, t) }
|
||||
func (t standaloneEnum) ProtoType(pref.EnumDescriptor) {}
|
||||
func (t standaloneEnum) ProtoInternal(pragma.DoNotImplement) {}
|
||||
func (t standaloneEnum) Parent() (pref.Descriptor, bool) { return nil, false }
|
||||
func (t standaloneEnum) Index() int { return 0 }
|
||||
func (t standaloneEnum) Syntax() pref.Syntax { return t.e.Syntax }
|
||||
func (t standaloneEnum) Name() pref.Name { return t.e.FullName.Name() }
|
||||
func (t standaloneEnum) FullName() pref.FullName { return t.e.FullName }
|
||||
func (t standaloneEnum) IsPlaceholder() bool { return false }
|
||||
func (t standaloneEnum) Options() pref.ProtoMessage { return altOptions(t.e.Options, optionTypes.Enum) }
|
||||
func (t standaloneEnum) Values() pref.EnumValueDescriptors { return t.e.vals.lazyInit(t, t.e.Values) }
|
||||
func (t standaloneEnum) ReservedNames() pref.Names { return (*names)(&t.e.ReservedNames) }
|
||||
func (t standaloneEnum) ReservedRanges() pref.EnumRanges { return (*enumRanges)(&t.e.ReservedRanges) }
|
||||
func (t standaloneEnum) Format(s fmt.State, r rune) { pfmt.FormatDesc(s, r, t) }
|
||||
func (t standaloneEnum) ProtoType(pref.EnumDescriptor) {}
|
||||
func (t standaloneEnum) ProtoInternal(pragma.DoNotImplement) {}
|
||||
|
||||
type standaloneExtension struct{ x *StandaloneExtension }
|
||||
|
||||
func (t standaloneExtension) Parent() (pref.Descriptor, bool) { return nil, false }
|
||||
func (t standaloneExtension) Index() int { return 0 }
|
||||
func (t standaloneExtension) Syntax() pref.Syntax { return pref.Proto2 }
|
||||
func (t standaloneExtension) Name() pref.Name { return t.x.FullName.Name() }
|
||||
func (t standaloneExtension) FullName() pref.FullName { return t.x.FullName }
|
||||
func (t standaloneExtension) IsPlaceholder() bool { return false }
|
||||
func (t standaloneExtension) DescriptorProto() (pref.Message, bool) { return nil, false }
|
||||
func (t standaloneExtension) Parent() (pref.Descriptor, bool) { return nil, false }
|
||||
func (t standaloneExtension) Index() int { return 0 }
|
||||
func (t standaloneExtension) Syntax() pref.Syntax { return pref.Proto2 }
|
||||
func (t standaloneExtension) Name() pref.Name { return t.x.FullName.Name() }
|
||||
func (t standaloneExtension) FullName() pref.FullName { return t.x.FullName }
|
||||
func (t standaloneExtension) IsPlaceholder() bool { return false }
|
||||
func (t standaloneExtension) Options() pref.ProtoMessage {
|
||||
return altOptions(t.x.Options, optionTypes.Field)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user