descriptors

package
Version: v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

此包是为扩展 google.protobuf.descriptor 的功能, 所有结构除了 protoc-gen-go 为每个 Field 生成的 getter: GetField() 之外, 还生成了 Field() 方法。

因为在 go/template 中,直接使用 {{.Message.Field}} 可能会有空指针问题, 而使用 {{.Message.GetField}} 又觉得太丑。 所以,现在可以安全又愉快地使用 {{.Message.Field}}

此外,还扩展了一些功能,参考:

type DescriptorCommon interface{} 全体都有的扩展方法
type Nestable interface{}  可嵌套的对象: message/enum
type ProtoType interface{} proto类型信息:  message/enum

Index

Constants

View Source
const (
	// 0 is reserved for errors
	FieldDescriptorProto_LABEL_OPTIONAL = descriptorpb.FieldDescriptorProto_LABEL_OPTIONAL
	FieldDescriptorProto_LABEL_REQUIRED = descriptorpb.FieldDescriptorProto_LABEL_REQUIRED
	FieldDescriptorProto_LABEL_REPEATED = descriptorpb.FieldDescriptorProto_LABEL_REPEATED
)
View Source
const (
	// 0 is reserved for errors.
	// Order is weird for historical reasons.
	FieldDescriptorProto_TYPE_DOUBLE = descriptorpb.FieldDescriptorProto_TYPE_DOUBLE
	FieldDescriptorProto_TYPE_FLOAT  = descriptorpb.FieldDescriptorProto_TYPE_FLOAT
	// Not ZigZag encoded.  Negative numbers take 10 bytes.  Use TYPE_SINT64 if
	// negative values are likely.
	FieldDescriptorProto_TYPE_INT64  = descriptorpb.FieldDescriptorProto_TYPE_INT64
	FieldDescriptorProto_TYPE_UINT64 = descriptorpb.FieldDescriptorProto_TYPE_UINT64
	// Not ZigZag encoded.  Negative numbers take 10 bytes.  Use TYPE_SINT32 if
	// negative values are likely.
	FieldDescriptorProto_TYPE_INT32   = descriptorpb.FieldDescriptorProto_TYPE_INT32
	FieldDescriptorProto_TYPE_FIXED64 = descriptorpb.FieldDescriptorProto_TYPE_FIXED64
	FieldDescriptorProto_TYPE_FIXED32 = descriptorpb.FieldDescriptorProto_TYPE_FIXED32
	FieldDescriptorProto_TYPE_BOOL    = descriptorpb.FieldDescriptorProto_TYPE_BOOL
	FieldDescriptorProto_TYPE_STRING  = descriptorpb.FieldDescriptorProto_TYPE_STRING
	// Tag-delimited aggregate.
	// Group type is deprecated and not supported in proto3. However, Proto3
	// implementations should still be able to parse the group wire format and
	// treat group fields as unknown fields.
	FieldDescriptorProto_TYPE_GROUP   = descriptorpb.FieldDescriptorProto_TYPE_GROUP
	FieldDescriptorProto_TYPE_MESSAGE = descriptorpb.FieldDescriptorProto_TYPE_MESSAGE // Length-delimited aggregate.
	// New in version 2.
	FieldDescriptorProto_TYPE_BYTES    = descriptorpb.FieldDescriptorProto_TYPE_BYTES
	FieldDescriptorProto_TYPE_UINT32   = descriptorpb.FieldDescriptorProto_TYPE_UINT32
	FieldDescriptorProto_TYPE_ENUM     = descriptorpb.FieldDescriptorProto_TYPE_ENUM
	FieldDescriptorProto_TYPE_SFIXED32 = descriptorpb.FieldDescriptorProto_TYPE_SFIXED32
	FieldDescriptorProto_TYPE_SFIXED64 = descriptorpb.FieldDescriptorProto_TYPE_SFIXED64
	FieldDescriptorProto_TYPE_SINT32   = descriptorpb.FieldDescriptorProto_TYPE_SINT32 // Uses ZigZag encoding.
	FieldDescriptorProto_TYPE_SINT64   = descriptorpb.FieldDescriptorProto_TYPE_SINT64 // Uses ZigZag encoding.
)
View Source
const (
	// Default mode.
	FieldOptions_STRING       = descriptorpb.FieldOptions_STRING
	FieldOptions_CORD         = descriptorpb.FieldOptions_CORD
	FieldOptions_STRING_PIECE = descriptorpb.FieldOptions_STRING_PIECE
)
View Source
const (
	// Use the default type.
	FieldOptions_JS_NORMAL = descriptorpb.FieldOptions_JS_NORMAL
	// Use JavaScript strings.
	FieldOptions_JS_STRING = descriptorpb.FieldOptions_JS_STRING
	// Use JavaScript numbers.
	FieldOptions_JS_NUMBER = descriptorpb.FieldOptions_JS_NUMBER
)
View Source
const (
	FileOptions_SPEED = descriptorpb.FileOptions_SPEED // Generate complete code for parsing, serialization,
	// etc.
	FileOptions_CODE_SIZE    = descriptorpb.FileOptions_CODE_SIZE    // Use ReflectionOps to implement these methods.
	FileOptions_LITE_RUNTIME = descriptorpb.FileOptions_LITE_RUNTIME // Generate code using MessageLite and the lite runtime.
)
View Source
const (
	MethodOptions_IDEMPOTENCY_UNKNOWN = descriptorpb.MethodOptions_IDEMPOTENCY_UNKNOWN
	MethodOptions_NO_SIDE_EFFECTS     = descriptorpb.MethodOptions_NO_SIDE_EFFECTS // implies idempotent
	MethodOptions_IDEMPOTENT          = descriptorpb.MethodOptions_IDEMPOTENT      // idempotent, but may have side effects
)

Variables

View Source
var NestableDescriptors = []Nestable{
	new(DescriptorProto),
	new(EnumDescriptorProto),
}

implemented Nestable types

View Source
var ProtoTypeDescriptors = []ProtoType{
	new(DescriptorProto),
	new(EnumDescriptorProto),
}

implemented ProtoType types

Functions

This section is empty.

Types

type DescriptorCommon

type DescriptorCommon interface {
	// 当前对象是否为空
	Empty() bool

	// 当前对象所属文件
	File() *FileDescriptorProto

	// 上级对象
	//  除了 FileDescriptorProto ,其他对象的 Parent 都不为 nil
	//  如 Method 的上级必定为 Service
	//
	//  注意:top level 的 message/enum 的 Parent 为 File
	//	    而嵌套(nested)的 message/enum 的 Parent 则为 message
	Parent() DescriptorCommon

	// 索引值
	//  如 Field 在其 Message 的序号
	//  默认为 -1
	Index() int

	// 获取source中的注释信息
	Comments() *SourceCodeInfo_Location
	// 获取 SourceCodeInfo.Location .Path
	LocationPath() LocationPath
	// 是否为顶级的消息
	//	即 Parent = FileDescriptorProto
	IsTopLevel() bool
}

每个结构都有的方法

type DescriptorProto

type DescriptorProto struct {
	// contains filtered or unexported fields
}

func (*DescriptorProto) Comments

func (*DescriptorProto) DescriptorProto

func (t *DescriptorProto) DescriptorProto() *descriptorpb.DescriptorProto

func (*DescriptorProto) Empty

func (t *DescriptorProto) Empty() bool

func (*DescriptorProto) EnumType

func (t *DescriptorProto) EnumType() []*EnumDescriptorProto

func (*DescriptorProto) Extension

func (t *DescriptorProto) Extension() []*FieldDescriptorProto

func (*DescriptorProto) ExtensionRange

func (t *DescriptorProto) ExtensionRange() []*DescriptorProto_ExtensionRange

func (*DescriptorProto) Field

func (t *DescriptorProto) Field() []*FieldDescriptorProto

func (*DescriptorProto) File

func (*DescriptorProto) GetEnumType

func (t *DescriptorProto) GetEnumType() (ret []*EnumDescriptorProto)

func (*DescriptorProto) GetExtension

func (t *DescriptorProto) GetExtension() (ret []*FieldDescriptorProto)

func (*DescriptorProto) GetExtensionRange

func (t *DescriptorProto) GetExtensionRange() (ret []*DescriptorProto_ExtensionRange)

func (*DescriptorProto) GetField

func (t *DescriptorProto) GetField() (ret []*FieldDescriptorProto)

func (*DescriptorProto) GetName

func (t *DescriptorProto) GetName() (ret string)

func (*DescriptorProto) GetNestedType

func (t *DescriptorProto) GetNestedType() (ret []*DescriptorProto)

func (*DescriptorProto) GetOneofDecl

func (t *DescriptorProto) GetOneofDecl() (ret []*OneofDescriptorProto)

func (*DescriptorProto) GetOptions

func (t *DescriptorProto) GetOptions() (ret *MessageOptions)

func (*DescriptorProto) GetReservedName

func (t *DescriptorProto) GetReservedName() (ret []string)

func (*DescriptorProto) GetReservedRange

func (t *DescriptorProto) GetReservedRange() (ret []*DescriptorProto_ReservedRange)

func (*DescriptorProto) Index

func (t *DescriptorProto) Index() int

func (*DescriptorProto) IsNested

func (t *DescriptorProto) IsNested() bool

func (*DescriptorProto) IsTopLevel

func (t *DescriptorProto) IsTopLevel() bool

implement DescriptorCommon.IsTopLevel

func (*DescriptorProto) LocationPath

func (t *DescriptorProto) LocationPath() LocationPath

func (*DescriptorProto) MarshalJSON

func (t *DescriptorProto) MarshalJSON() (b []byte, err error)

func (*DescriptorProto) Name

func (t *DescriptorProto) Name() string

func (*DescriptorProto) NestedType

func (t *DescriptorProto) NestedType() []*DescriptorProto

func (*DescriptorProto) OneofDecl

func (t *DescriptorProto) OneofDecl() []*OneofDescriptorProto

func (*DescriptorProto) Options

func (t *DescriptorProto) Options() *MessageOptions

func (*DescriptorProto) Parent

func (t *DescriptorProto) Parent() DescriptorCommon

func (*DescriptorProto) ParentMessage

func (t *DescriptorProto) ParentMessage() *DescriptorProto

func (*DescriptorProto) PbDescriptor

func (t *DescriptorProto) PbDescriptor() *descriptorpb.DescriptorProto

func (*DescriptorProto) ProtoType

func (t *DescriptorProto) ProtoType() *PbTypeInfo

func (*DescriptorProto) ReservedName

func (t *DescriptorProto) ReservedName() []string

func (*DescriptorProto) ReservedRange

func (t *DescriptorProto) ReservedRange() []*DescriptorProto_ReservedRange

type DescriptorProto_ExtensionRange

type DescriptorProto_ExtensionRange struct {
	// contains filtered or unexported fields
}

func (*DescriptorProto_ExtensionRange) Comments

func (*DescriptorProto_ExtensionRange) DescriptorProto_ExtensionRange

func (t *DescriptorProto_ExtensionRange) DescriptorProto_ExtensionRange() *descriptorpb.DescriptorProto_ExtensionRange

func (*DescriptorProto_ExtensionRange) Empty

func (*DescriptorProto_ExtensionRange) End

func (*DescriptorProto_ExtensionRange) File

func (*DescriptorProto_ExtensionRange) GetEnd

func (t *DescriptorProto_ExtensionRange) GetEnd() (ret int32)

func (*DescriptorProto_ExtensionRange) GetOptions

func (*DescriptorProto_ExtensionRange) GetStart

func (t *DescriptorProto_ExtensionRange) GetStart() (ret int32)

func (*DescriptorProto_ExtensionRange) Index

func (*DescriptorProto_ExtensionRange) IsTopLevel

func (t *DescriptorProto_ExtensionRange) IsTopLevel() bool

implement DescriptorCommon.IsTopLevel

func (*DescriptorProto_ExtensionRange) LocationPath

func (t *DescriptorProto_ExtensionRange) LocationPath() LocationPath

func (*DescriptorProto_ExtensionRange) MarshalJSON

func (t *DescriptorProto_ExtensionRange) MarshalJSON() (b []byte, err error)

func (*DescriptorProto_ExtensionRange) Options

func (*DescriptorProto_ExtensionRange) Parent

func (*DescriptorProto_ExtensionRange) PbDescriptor

func (*DescriptorProto_ExtensionRange) Start

type DescriptorProto_ReservedRange

type DescriptorProto_ReservedRange struct {
	// contains filtered or unexported fields
}

func (*DescriptorProto_ReservedRange) Comments

func (*DescriptorProto_ReservedRange) DescriptorProto_ReservedRange

func (t *DescriptorProto_ReservedRange) DescriptorProto_ReservedRange() *descriptorpb.DescriptorProto_ReservedRange

func (*DescriptorProto_ReservedRange) Empty

func (*DescriptorProto_ReservedRange) End

func (*DescriptorProto_ReservedRange) File

func (*DescriptorProto_ReservedRange) GetEnd

func (t *DescriptorProto_ReservedRange) GetEnd() (ret int32)

func (*DescriptorProto_ReservedRange) GetStart

func (t *DescriptorProto_ReservedRange) GetStart() (ret int32)

func (*DescriptorProto_ReservedRange) Index

func (*DescriptorProto_ReservedRange) IsTopLevel

func (t *DescriptorProto_ReservedRange) IsTopLevel() bool

implement DescriptorCommon.IsTopLevel

func (*DescriptorProto_ReservedRange) LocationPath

func (t *DescriptorProto_ReservedRange) LocationPath() LocationPath

func (*DescriptorProto_ReservedRange) MarshalJSON

func (t *DescriptorProto_ReservedRange) MarshalJSON() (b []byte, err error)

func (*DescriptorProto_ReservedRange) Parent

func (*DescriptorProto_ReservedRange) PbDescriptor

func (*DescriptorProto_ReservedRange) Start

type EnumDescriptorProto

type EnumDescriptorProto struct {
	// contains filtered or unexported fields
}

func (*EnumDescriptorProto) Comments

func (*EnumDescriptorProto) Empty

func (t *EnumDescriptorProto) Empty() bool

func (*EnumDescriptorProto) EnumDescriptorProto

func (t *EnumDescriptorProto) EnumDescriptorProto() *descriptorpb.EnumDescriptorProto

func (*EnumDescriptorProto) File

func (*EnumDescriptorProto) GetName

func (t *EnumDescriptorProto) GetName() (ret string)

func (*EnumDescriptorProto) GetOptions

func (t *EnumDescriptorProto) GetOptions() (ret *EnumOptions)

func (*EnumDescriptorProto) GetReservedName

func (t *EnumDescriptorProto) GetReservedName() (ret []string)

func (*EnumDescriptorProto) GetReservedRange

func (t *EnumDescriptorProto) GetReservedRange() (ret []*EnumDescriptorProto_EnumReservedRange)

func (*EnumDescriptorProto) GetValue

func (t *EnumDescriptorProto) GetValue() (ret []*EnumValueDescriptorProto)

func (*EnumDescriptorProto) Index

func (t *EnumDescriptorProto) Index() int

func (*EnumDescriptorProto) IsNested

func (t *EnumDescriptorProto) IsNested() bool

func (*EnumDescriptorProto) IsTopLevel

func (t *EnumDescriptorProto) IsTopLevel() bool

implement DescriptorCommon.IsTopLevel

func (*EnumDescriptorProto) LocationPath

func (t *EnumDescriptorProto) LocationPath() LocationPath

func (*EnumDescriptorProto) MarshalJSON

func (t *EnumDescriptorProto) MarshalJSON() (b []byte, err error)

func (*EnumDescriptorProto) Name

func (t *EnumDescriptorProto) Name() string

func (*EnumDescriptorProto) Options

func (t *EnumDescriptorProto) Options() *EnumOptions

func (*EnumDescriptorProto) Parent

func (*EnumDescriptorProto) ParentMessage

func (t *EnumDescriptorProto) ParentMessage() *DescriptorProto

func (*EnumDescriptorProto) PbDescriptor

func (*EnumDescriptorProto) ProtoType

func (t *EnumDescriptorProto) ProtoType() *PbTypeInfo

func (*EnumDescriptorProto) ReservedName

func (t *EnumDescriptorProto) ReservedName() []string

func (*EnumDescriptorProto) ReservedRange

func (*EnumDescriptorProto) Value

type EnumDescriptorProto_EnumReservedRange

type EnumDescriptorProto_EnumReservedRange struct {
	// contains filtered or unexported fields
}

func (*EnumDescriptorProto_EnumReservedRange) Comments

func (*EnumDescriptorProto_EnumReservedRange) Empty

func (*EnumDescriptorProto_EnumReservedRange) End

func (*EnumDescriptorProto_EnumReservedRange) EnumDescriptorProto_EnumReservedRange

func (*EnumDescriptorProto_EnumReservedRange) File

func (*EnumDescriptorProto_EnumReservedRange) GetEnd

func (t *EnumDescriptorProto_EnumReservedRange) GetEnd() (ret int32)

func (*EnumDescriptorProto_EnumReservedRange) GetStart

func (t *EnumDescriptorProto_EnumReservedRange) GetStart() (ret int32)

func (*EnumDescriptorProto_EnumReservedRange) Index

func (*EnumDescriptorProto_EnumReservedRange) IsTopLevel

func (t *EnumDescriptorProto_EnumReservedRange) IsTopLevel() bool

implement DescriptorCommon.IsTopLevel

func (*EnumDescriptorProto_EnumReservedRange) LocationPath

func (*EnumDescriptorProto_EnumReservedRange) MarshalJSON

func (t *EnumDescriptorProto_EnumReservedRange) MarshalJSON() (b []byte, err error)

func (*EnumDescriptorProto_EnumReservedRange) Parent

func (*EnumDescriptorProto_EnumReservedRange) PbDescriptor

func (*EnumDescriptorProto_EnumReservedRange) Start

type EnumOptions

type EnumOptions struct {
	// contains filtered or unexported fields
}

func (*EnumOptions) AllowAlias

func (t *EnumOptions) AllowAlias() bool

func (*EnumOptions) Comments

func (t *EnumOptions) Comments() *SourceCodeInfo_Location

func (*EnumOptions) Deprecated

func (t *EnumOptions) Deprecated() bool

func (*EnumOptions) Empty

func (t *EnumOptions) Empty() bool

func (*EnumOptions) EnumOptions

func (t *EnumOptions) EnumOptions() *descriptorpb.EnumOptions

func (*EnumOptions) File

func (t *EnumOptions) File() *FileDescriptorProto

func (*EnumOptions) GetAllowAlias

func (t *EnumOptions) GetAllowAlias() (ret bool)

func (*EnumOptions) GetDeprecated

func (t *EnumOptions) GetDeprecated() (ret bool)

func (*EnumOptions) GetUninterpretedOption

func (t *EnumOptions) GetUninterpretedOption() (ret []*UninterpretedOption)

func (*EnumOptions) Index

func (t *EnumOptions) Index() int

func (*EnumOptions) IsTopLevel

func (t *EnumOptions) IsTopLevel() bool

implement DescriptorCommon.IsTopLevel

func (*EnumOptions) LocationPath

func (t *EnumOptions) LocationPath() LocationPath

func (*EnumOptions) MarshalJSON

func (t *EnumOptions) MarshalJSON() (b []byte, err error)

func (*EnumOptions) Parent

func (t *EnumOptions) Parent() DescriptorCommon

func (*EnumOptions) PbDescriptor

func (t *EnumOptions) PbDescriptor() *descriptorpb.EnumOptions

func (*EnumOptions) UninterpretedOption

func (t *EnumOptions) UninterpretedOption() []*UninterpretedOption

type EnumValueDescriptorProto

type EnumValueDescriptorProto struct {
	// contains filtered or unexported fields
}

func (*EnumValueDescriptorProto) Comments

func (*EnumValueDescriptorProto) Empty

func (t *EnumValueDescriptorProto) Empty() bool

func (*EnumValueDescriptorProto) EnumValueDescriptorProto

func (t *EnumValueDescriptorProto) EnumValueDescriptorProto() *descriptorpb.EnumValueDescriptorProto

func (*EnumValueDescriptorProto) File

func (*EnumValueDescriptorProto) GetName

func (t *EnumValueDescriptorProto) GetName() (ret string)

func (*EnumValueDescriptorProto) GetNumber

func (t *EnumValueDescriptorProto) GetNumber() (ret int32)

func (*EnumValueDescriptorProto) GetOptions

func (t *EnumValueDescriptorProto) GetOptions() (ret *EnumValueOptions)

func (*EnumValueDescriptorProto) Index

func (t *EnumValueDescriptorProto) Index() int

func (*EnumValueDescriptorProto) IsTopLevel

func (t *EnumValueDescriptorProto) IsTopLevel() bool

implement DescriptorCommon.IsTopLevel

func (*EnumValueDescriptorProto) LocationPath

func (t *EnumValueDescriptorProto) LocationPath() LocationPath

func (*EnumValueDescriptorProto) MarshalJSON

func (t *EnumValueDescriptorProto) MarshalJSON() (b []byte, err error)

func (*EnumValueDescriptorProto) Name

func (t *EnumValueDescriptorProto) Name() string

func (*EnumValueDescriptorProto) Number

func (t *EnumValueDescriptorProto) Number() int32

func (*EnumValueDescriptorProto) Options

func (*EnumValueDescriptorProto) Parent

func (*EnumValueDescriptorProto) PbDescriptor

type EnumValueOptions

type EnumValueOptions struct {
	// contains filtered or unexported fields
}

func (*EnumValueOptions) Comments

func (*EnumValueOptions) Deprecated

func (t *EnumValueOptions) Deprecated() bool

func (*EnumValueOptions) Empty

func (t *EnumValueOptions) Empty() bool

func (*EnumValueOptions) EnumValueOptions

func (t *EnumValueOptions) EnumValueOptions() *descriptorpb.EnumValueOptions

func (*EnumValueOptions) File

func (*EnumValueOptions) GetDeprecated

func (t *EnumValueOptions) GetDeprecated() (ret bool)

func (*EnumValueOptions) GetUninterpretedOption

func (t *EnumValueOptions) GetUninterpretedOption() (ret []*UninterpretedOption)

func (*EnumValueOptions) Index

func (t *EnumValueOptions) Index() int

func (*EnumValueOptions) IsTopLevel

func (t *EnumValueOptions) IsTopLevel() bool

implement DescriptorCommon.IsTopLevel

func (*EnumValueOptions) LocationPath

func (t *EnumValueOptions) LocationPath() LocationPath

func (*EnumValueOptions) MarshalJSON

func (t *EnumValueOptions) MarshalJSON() (b []byte, err error)

func (*EnumValueOptions) Parent

func (t *EnumValueOptions) Parent() DescriptorCommon

func (*EnumValueOptions) PbDescriptor

func (t *EnumValueOptions) PbDescriptor() *descriptorpb.EnumValueOptions

func (*EnumValueOptions) UninterpretedOption

func (t *EnumValueOptions) UninterpretedOption() []*UninterpretedOption

type ExtensionRangeOptions

type ExtensionRangeOptions struct {
	// contains filtered or unexported fields
}

func (*ExtensionRangeOptions) Comments

func (*ExtensionRangeOptions) Empty

func (t *ExtensionRangeOptions) Empty() bool

func (*ExtensionRangeOptions) ExtensionRangeOptions

func (t *ExtensionRangeOptions) ExtensionRangeOptions() *descriptorpb.ExtensionRangeOptions

func (*ExtensionRangeOptions) File

func (*ExtensionRangeOptions) GetUninterpretedOption

func (t *ExtensionRangeOptions) GetUninterpretedOption() (ret []*UninterpretedOption)

func (*ExtensionRangeOptions) Index

func (t *ExtensionRangeOptions) Index() int

func (*ExtensionRangeOptions) IsTopLevel

func (t *ExtensionRangeOptions) IsTopLevel() bool

implement DescriptorCommon.IsTopLevel

func (*ExtensionRangeOptions) LocationPath

func (t *ExtensionRangeOptions) LocationPath() LocationPath

func (*ExtensionRangeOptions) MarshalJSON

func (t *ExtensionRangeOptions) MarshalJSON() (b []byte, err error)

func (*ExtensionRangeOptions) Parent

func (*ExtensionRangeOptions) PbDescriptor

func (*ExtensionRangeOptions) UninterpretedOption

func (t *ExtensionRangeOptions) UninterpretedOption() []*UninterpretedOption

type FieldDescriptorProto

type FieldDescriptorProto struct {
	// contains filtered or unexported fields
}

func (*FieldDescriptorProto) Comments

func (*FieldDescriptorProto) DefaultValue

func (t *FieldDescriptorProto) DefaultValue() string

func (*FieldDescriptorProto) Empty

func (t *FieldDescriptorProto) Empty() bool

func (*FieldDescriptorProto) Extendee

func (t *FieldDescriptorProto) Extendee() string

func (*FieldDescriptorProto) FieldDescriptorProto

func (t *FieldDescriptorProto) FieldDescriptorProto() *descriptorpb.FieldDescriptorProto

func (*FieldDescriptorProto) File

func (*FieldDescriptorProto) GetDefaultValue

func (t *FieldDescriptorProto) GetDefaultValue() (ret string)

func (*FieldDescriptorProto) GetExtendee

func (t *FieldDescriptorProto) GetExtendee() (ret string)

func (*FieldDescriptorProto) GetJsonName

func (t *FieldDescriptorProto) GetJsonName() (ret string)

func (*FieldDescriptorProto) GetLabel

func (*FieldDescriptorProto) GetName

func (t *FieldDescriptorProto) GetName() (ret string)

func (*FieldDescriptorProto) GetNumber

func (t *FieldDescriptorProto) GetNumber() (ret int32)

func (*FieldDescriptorProto) GetOneofIndex

func (t *FieldDescriptorProto) GetOneofIndex() (ret int32)

func (*FieldDescriptorProto) GetOptions

func (t *FieldDescriptorProto) GetOptions() (ret *FieldOptions)

func (*FieldDescriptorProto) GetType

func (*FieldDescriptorProto) GetTypeName

func (t *FieldDescriptorProto) GetTypeName() (ret string)

func (*FieldDescriptorProto) Index

func (t *FieldDescriptorProto) Index() int

func (*FieldDescriptorProto) IsOptional

func (t *FieldDescriptorProto) IsOptional() bool

func (*FieldDescriptorProto) IsRepeated

func (t *FieldDescriptorProto) IsRepeated() bool

func (*FieldDescriptorProto) IsRequired

func (t *FieldDescriptorProto) IsRequired() bool

func (*FieldDescriptorProto) IsTopLevel

func (t *FieldDescriptorProto) IsTopLevel() bool

implement DescriptorCommon.IsTopLevel

func (*FieldDescriptorProto) JsonName

func (t *FieldDescriptorProto) JsonName() string

func (*FieldDescriptorProto) Label

func (*FieldDescriptorProto) LocationPath

func (t *FieldDescriptorProto) LocationPath() LocationPath

func (*FieldDescriptorProto) MarshalJSON

func (t *FieldDescriptorProto) MarshalJSON() (b []byte, err error)

func (*FieldDescriptorProto) Name

func (t *FieldDescriptorProto) Name() string

func (*FieldDescriptorProto) Number

func (t *FieldDescriptorProto) Number() int32

func (*FieldDescriptorProto) OneofIndex

func (t *FieldDescriptorProto) OneofIndex() int32

func (*FieldDescriptorProto) Options

func (t *FieldDescriptorProto) Options() *FieldOptions

func (*FieldDescriptorProto) Parent

func (*FieldDescriptorProto) PbDescriptor

func (*FieldDescriptorProto) Type

func (*FieldDescriptorProto) TypeName

func (t *FieldDescriptorProto) TypeName() string

type FieldDescriptorProto_Label

type FieldDescriptorProto_Label = descriptorpb.FieldDescriptorProto_Label

FieldDescriptorProto_Label

See descriptorpb.FieldDescriptorProto_Label

type FieldDescriptorProto_Type

type FieldDescriptorProto_Type = descriptorpb.FieldDescriptorProto_Type

FieldDescriptorProto_Type

See descriptorpb.FieldDescriptorProto_Type

type FieldOptions

type FieldOptions struct {
	// contains filtered or unexported fields
}

func (*FieldOptions) Comments

func (t *FieldOptions) Comments() *SourceCodeInfo_Location

func (*FieldOptions) Ctype

func (t *FieldOptions) Ctype() FieldOptions_CType

func (*FieldOptions) Deprecated

func (t *FieldOptions) Deprecated() bool

func (*FieldOptions) Empty

func (t *FieldOptions) Empty() bool

func (*FieldOptions) FieldOptions

func (t *FieldOptions) FieldOptions() *descriptorpb.FieldOptions

func (*FieldOptions) File

func (t *FieldOptions) File() *FileDescriptorProto

func (*FieldOptions) GetCtype

func (t *FieldOptions) GetCtype() (ret FieldOptions_CType)

func (*FieldOptions) GetDeprecated

func (t *FieldOptions) GetDeprecated() (ret bool)

func (*FieldOptions) GetJstype

func (t *FieldOptions) GetJstype() (ret FieldOptions_JSType)

func (*FieldOptions) GetLazy

func (t *FieldOptions) GetLazy() (ret bool)

func (*FieldOptions) GetPacked

func (t *FieldOptions) GetPacked() (ret bool)

func (*FieldOptions) GetUninterpretedOption

func (t *FieldOptions) GetUninterpretedOption() (ret []*UninterpretedOption)

func (*FieldOptions) GetWeak

func (t *FieldOptions) GetWeak() (ret bool)

func (*FieldOptions) Index

func (t *FieldOptions) Index() int

func (*FieldOptions) IsTopLevel

func (t *FieldOptions) IsTopLevel() bool

implement DescriptorCommon.IsTopLevel

func (*FieldOptions) Jstype

func (t *FieldOptions) Jstype() FieldOptions_JSType

func (*FieldOptions) Lazy

func (t *FieldOptions) Lazy() bool

func (*FieldOptions) LocationPath

func (t *FieldOptions) LocationPath() LocationPath

func (*FieldOptions) MarshalJSON

func (t *FieldOptions) MarshalJSON() (b []byte, err error)

func (*FieldOptions) Packed

func (t *FieldOptions) Packed() bool

func (*FieldOptions) Parent

func (t *FieldOptions) Parent() DescriptorCommon

func (*FieldOptions) PbDescriptor

func (t *FieldOptions) PbDescriptor() *descriptorpb.FieldOptions

func (*FieldOptions) UninterpretedOption

func (t *FieldOptions) UninterpretedOption() []*UninterpretedOption

func (*FieldOptions) Weak

func (t *FieldOptions) Weak() bool

type FieldOptions_CType

type FieldOptions_CType = descriptorpb.FieldOptions_CType

FieldOptions_CType

See descriptorpb.FieldOptions_CType

type FieldOptions_JSType

type FieldOptions_JSType = descriptorpb.FieldOptions_JSType

FieldOptions_JSType

See descriptorpb.FieldOptions_JSType

type FileDescriptorProto

type FileDescriptorProto struct {
	// contains filtered or unexported fields
}

func NewFileDescriptorProto

func NewFileDescriptorProto(file *descriptor.FileDescriptorProto) *FileDescriptorProto

//////////////////////////////////////////////////////////////////// NewFileDescriptorProto 是唯一允许公开的构造器

func (*FileDescriptorProto) Comments

func (*FileDescriptorProto) Dependency

func (t *FileDescriptorProto) Dependency() []string

func (*FileDescriptorProto) Empty

func (t *FileDescriptorProto) Empty() bool

func (*FileDescriptorProto) EnumType

func (t *FileDescriptorProto) EnumType() []*EnumDescriptorProto

func (*FileDescriptorProto) Extension

func (t *FileDescriptorProto) Extension() []*FieldDescriptorProto

func (*FileDescriptorProto) File

func (*FileDescriptorProto) FileDescriptorProto

func (t *FileDescriptorProto) FileDescriptorProto() *descriptorpb.FileDescriptorProto

func (*FileDescriptorProto) GetDependency

func (t *FileDescriptorProto) GetDependency() (ret []string)

func (*FileDescriptorProto) GetEnumType

func (t *FileDescriptorProto) GetEnumType() (ret []*EnumDescriptorProto)

func (*FileDescriptorProto) GetExtension

func (t *FileDescriptorProto) GetExtension() (ret []*FieldDescriptorProto)

func (*FileDescriptorProto) GetMessageType

func (t *FileDescriptorProto) GetMessageType() (ret []*DescriptorProto)

func (*FileDescriptorProto) GetName

func (t *FileDescriptorProto) GetName() (ret string)

func (*FileDescriptorProto) GetOptions

func (t *FileDescriptorProto) GetOptions() (ret *FileOptions)

func (*FileDescriptorProto) GetPackage

func (t *FileDescriptorProto) GetPackage() (ret string)

func (*FileDescriptorProto) GetPublicDependency

func (t *FileDescriptorProto) GetPublicDependency() (ret []int32)

func (*FileDescriptorProto) GetService

func (t *FileDescriptorProto) GetService() (ret []*ServiceDescriptorProto)

func (*FileDescriptorProto) GetSourceCodeInfo

func (t *FileDescriptorProto) GetSourceCodeInfo() (ret *SourceCodeInfo)

func (*FileDescriptorProto) GetSyntax

func (t *FileDescriptorProto) GetSyntax() (ret string)

func (*FileDescriptorProto) GetWeakDependency

func (t *FileDescriptorProto) GetWeakDependency() (ret []int32)

func (*FileDescriptorProto) Index

func (t *FileDescriptorProto) Index() int

func (*FileDescriptorProto) IsProto2

func (t *FileDescriptorProto) IsProto2() bool

func (*FileDescriptorProto) IsProto3

func (t *FileDescriptorProto) IsProto3() bool

func (*FileDescriptorProto) IsTopLevel

func (t *FileDescriptorProto) IsTopLevel() bool

implement DescriptorCommon.IsTopLevel

func (*FileDescriptorProto) LocationPath

func (t *FileDescriptorProto) LocationPath() LocationPath

func (*FileDescriptorProto) MarshalJSON

func (t *FileDescriptorProto) MarshalJSON() (b []byte, err error)

func (*FileDescriptorProto) MessageType

func (t *FileDescriptorProto) MessageType() []*DescriptorProto

func (*FileDescriptorProto) Name

func (t *FileDescriptorProto) Name() string

func (*FileDescriptorProto) Options

func (t *FileDescriptorProto) Options() *FileOptions

func (*FileDescriptorProto) Package

func (t *FileDescriptorProto) Package() string

func (*FileDescriptorProto) Parent

func (*FileDescriptorProto) PbDescriptor

func (*FileDescriptorProto) PublicDependency

func (t *FileDescriptorProto) PublicDependency() []int32

func (*FileDescriptorProto) Service

func (*FileDescriptorProto) SourceCodeInfo

func (t *FileDescriptorProto) SourceCodeInfo() *SourceCodeInfo

func (*FileDescriptorProto) Syntax

func (t *FileDescriptorProto) Syntax() string

func (*FileDescriptorProto) WeakDependency

func (t *FileDescriptorProto) WeakDependency() []int32

type FileOptions

type FileOptions struct {
	// contains filtered or unexported fields
}

func (*FileOptions) CcEnableArenas

func (t *FileOptions) CcEnableArenas() bool

func (*FileOptions) CcGenericServices

func (t *FileOptions) CcGenericServices() bool

func (*FileOptions) Comments

func (t *FileOptions) Comments() *SourceCodeInfo_Location

func (*FileOptions) CsharpNamespace

func (t *FileOptions) CsharpNamespace() string

func (*FileOptions) Deprecated

func (t *FileOptions) Deprecated() bool

func (*FileOptions) Empty

func (t *FileOptions) Empty() bool

func (*FileOptions) File

func (t *FileOptions) File() *FileDescriptorProto

func (*FileOptions) FileOptions

func (t *FileOptions) FileOptions() *descriptorpb.FileOptions

func (*FileOptions) GetCcEnableArenas

func (t *FileOptions) GetCcEnableArenas() (ret bool)

func (*FileOptions) GetCcGenericServices

func (t *FileOptions) GetCcGenericServices() (ret bool)

func (*FileOptions) GetCsharpNamespace

func (t *FileOptions) GetCsharpNamespace() (ret string)

func (*FileOptions) GetDeprecated

func (t *FileOptions) GetDeprecated() (ret bool)

func (*FileOptions) GetGoPackage

func (t *FileOptions) GetGoPackage() (ret string)

func (*FileOptions) GetJavaGenerateEqualsAndHash

func (t *FileOptions) GetJavaGenerateEqualsAndHash() (ret bool)

func (*FileOptions) GetJavaGenericServices

func (t *FileOptions) GetJavaGenericServices() (ret bool)

func (*FileOptions) GetJavaMultipleFiles

func (t *FileOptions) GetJavaMultipleFiles() (ret bool)

func (*FileOptions) GetJavaOuterClassname

func (t *FileOptions) GetJavaOuterClassname() (ret string)

func (*FileOptions) GetJavaPackage

func (t *FileOptions) GetJavaPackage() (ret string)

func (*FileOptions) GetJavaStringCheckUtf8

func (t *FileOptions) GetJavaStringCheckUtf8() (ret bool)

func (*FileOptions) GetObjcClassPrefix

func (t *FileOptions) GetObjcClassPrefix() (ret string)

func (*FileOptions) GetOptimizeFor

func (t *FileOptions) GetOptimizeFor() (ret FileOptions_OptimizeMode)

func (*FileOptions) GetPhpClassPrefix

func (t *FileOptions) GetPhpClassPrefix() (ret string)

func (*FileOptions) GetPhpGenericServices

func (t *FileOptions) GetPhpGenericServices() (ret bool)

func (*FileOptions) GetPhpMetadataNamespace

func (t *FileOptions) GetPhpMetadataNamespace() (ret string)

func (*FileOptions) GetPhpNamespace

func (t *FileOptions) GetPhpNamespace() (ret string)

func (*FileOptions) GetPyGenericServices

func (t *FileOptions) GetPyGenericServices() (ret bool)

func (*FileOptions) GetRubyPackage

func (t *FileOptions) GetRubyPackage() (ret string)

func (*FileOptions) GetSwiftPrefix

func (t *FileOptions) GetSwiftPrefix() (ret string)

func (*FileOptions) GetUninterpretedOption

func (t *FileOptions) GetUninterpretedOption() (ret []*UninterpretedOption)

func (*FileOptions) GoPackage

func (t *FileOptions) GoPackage() string

func (*FileOptions) Index

func (t *FileOptions) Index() int

func (*FileOptions) IsTopLevel

func (t *FileOptions) IsTopLevel() bool

implement DescriptorCommon.IsTopLevel

func (*FileOptions) JavaGenerateEqualsAndHash

func (t *FileOptions) JavaGenerateEqualsAndHash() bool

func (*FileOptions) JavaGenericServices

func (t *FileOptions) JavaGenericServices() bool

func (*FileOptions) JavaMultipleFiles

func (t *FileOptions) JavaMultipleFiles() bool

func (*FileOptions) JavaOuterClassname

func (t *FileOptions) JavaOuterClassname() string

func (*FileOptions) JavaPackage

func (t *FileOptions) JavaPackage() string

func (*FileOptions) JavaStringCheckUtf8

func (t *FileOptions) JavaStringCheckUtf8() bool

func (*FileOptions) LocationPath

func (t *FileOptions) LocationPath() LocationPath

func (*FileOptions) MarshalJSON

func (t *FileOptions) MarshalJSON() (b []byte, err error)

func (*FileOptions) ObjcClassPrefix

func (t *FileOptions) ObjcClassPrefix() string

func (*FileOptions) OptimizeFor

func (t *FileOptions) OptimizeFor() FileOptions_OptimizeMode

func (*FileOptions) Parent

func (t *FileOptions) Parent() DescriptorCommon

func (*FileOptions) PbDescriptor

func (t *FileOptions) PbDescriptor() *descriptorpb.FileOptions

func (*FileOptions) PhpClassPrefix

func (t *FileOptions) PhpClassPrefix() string

func (*FileOptions) PhpGenericServices

func (t *FileOptions) PhpGenericServices() bool

func (*FileOptions) PhpMetadataNamespace

func (t *FileOptions) PhpMetadataNamespace() string

func (*FileOptions) PhpNamespace

func (t *FileOptions) PhpNamespace() string

func (*FileOptions) PyGenericServices

func (t *FileOptions) PyGenericServices() bool

func (*FileOptions) RubyPackage

func (t *FileOptions) RubyPackage() string

func (*FileOptions) SwiftPrefix

func (t *FileOptions) SwiftPrefix() string

func (*FileOptions) UninterpretedOption

func (t *FileOptions) UninterpretedOption() []*UninterpretedOption

type FileOptions_OptimizeMode

type FileOptions_OptimizeMode = descriptorpb.FileOptions_OptimizeMode

FileOptions_OptimizeMode

See descriptorpb.FileOptions_OptimizeMode

Generated classes can be optimized for speed or code size.

type GeneratedCodeInfo

type GeneratedCodeInfo struct {
	// contains filtered or unexported fields
}

func (*GeneratedCodeInfo) Annotation

func (*GeneratedCodeInfo) Comments

func (*GeneratedCodeInfo) Empty

func (t *GeneratedCodeInfo) Empty() bool

func (*GeneratedCodeInfo) File

func (*GeneratedCodeInfo) GeneratedCodeInfo

func (t *GeneratedCodeInfo) GeneratedCodeInfo() *descriptorpb.GeneratedCodeInfo

func (*GeneratedCodeInfo) GetAnnotation

func (t *GeneratedCodeInfo) GetAnnotation() (ret []*GeneratedCodeInfo_Annotation)

func (*GeneratedCodeInfo) Index

func (t *GeneratedCodeInfo) Index() int

func (*GeneratedCodeInfo) IsTopLevel

func (t *GeneratedCodeInfo) IsTopLevel() bool

implement DescriptorCommon.IsTopLevel

func (*GeneratedCodeInfo) LocationPath

func (t *GeneratedCodeInfo) LocationPath() LocationPath

func (*GeneratedCodeInfo) MarshalJSON

func (t *GeneratedCodeInfo) MarshalJSON() (b []byte, err error)

func (*GeneratedCodeInfo) Parent

func (t *GeneratedCodeInfo) Parent() DescriptorCommon

func (*GeneratedCodeInfo) PbDescriptor

type GeneratedCodeInfo_Annotation

type GeneratedCodeInfo_Annotation struct {
	// contains filtered or unexported fields
}

func (*GeneratedCodeInfo_Annotation) Begin

func (*GeneratedCodeInfo_Annotation) Comments

func (*GeneratedCodeInfo_Annotation) Empty

func (*GeneratedCodeInfo_Annotation) End

func (*GeneratedCodeInfo_Annotation) File

func (*GeneratedCodeInfo_Annotation) GeneratedCodeInfo_Annotation

func (t *GeneratedCodeInfo_Annotation) GeneratedCodeInfo_Annotation() *descriptorpb.GeneratedCodeInfo_Annotation

func (*GeneratedCodeInfo_Annotation) GetBegin

func (t *GeneratedCodeInfo_Annotation) GetBegin() (ret int32)

func (*GeneratedCodeInfo_Annotation) GetEnd

func (t *GeneratedCodeInfo_Annotation) GetEnd() (ret int32)

func (*GeneratedCodeInfo_Annotation) GetPath

func (t *GeneratedCodeInfo_Annotation) GetPath() (ret []int32)

func (*GeneratedCodeInfo_Annotation) GetSourceFile

func (t *GeneratedCodeInfo_Annotation) GetSourceFile() (ret string)

func (*GeneratedCodeInfo_Annotation) Index

func (t *GeneratedCodeInfo_Annotation) Index() int

func (*GeneratedCodeInfo_Annotation) IsTopLevel

func (t *GeneratedCodeInfo_Annotation) IsTopLevel() bool

implement DescriptorCommon.IsTopLevel

func (*GeneratedCodeInfo_Annotation) LocationPath

func (t *GeneratedCodeInfo_Annotation) LocationPath() LocationPath

func (*GeneratedCodeInfo_Annotation) MarshalJSON

func (t *GeneratedCodeInfo_Annotation) MarshalJSON() (b []byte, err error)

func (*GeneratedCodeInfo_Annotation) Parent

func (*GeneratedCodeInfo_Annotation) Path

func (t *GeneratedCodeInfo_Annotation) Path() []int32

func (*GeneratedCodeInfo_Annotation) PbDescriptor

func (*GeneratedCodeInfo_Annotation) SourceFile

func (t *GeneratedCodeInfo_Annotation) SourceFile() string

type LocationPath

type LocationPath []int32

func (LocationPath) String

func (p LocationPath) String() string

type MessageOptions

type MessageOptions struct {
	// contains filtered or unexported fields
}

func (*MessageOptions) Comments

func (t *MessageOptions) Comments() *SourceCodeInfo_Location

func (*MessageOptions) Deprecated

func (t *MessageOptions) Deprecated() bool

func (*MessageOptions) Empty

func (t *MessageOptions) Empty() bool

func (*MessageOptions) File

func (*MessageOptions) GetDeprecated

func (t *MessageOptions) GetDeprecated() (ret bool)

func (*MessageOptions) GetMapEntry

func (t *MessageOptions) GetMapEntry() (ret bool)

func (*MessageOptions) GetMessageSetWireFormat

func (t *MessageOptions) GetMessageSetWireFormat() (ret bool)

func (*MessageOptions) GetNoStandardDescriptorAccessor

func (t *MessageOptions) GetNoStandardDescriptorAccessor() (ret bool)

func (*MessageOptions) GetUninterpretedOption

func (t *MessageOptions) GetUninterpretedOption() (ret []*UninterpretedOption)

func (*MessageOptions) Index

func (t *MessageOptions) Index() int

func (*MessageOptions) IsTopLevel

func (t *MessageOptions) IsTopLevel() bool

implement DescriptorCommon.IsTopLevel

func (*MessageOptions) LocationPath

func (t *MessageOptions) LocationPath() LocationPath

func (*MessageOptions) MapEntry

func (t *MessageOptions) MapEntry() bool

func (*MessageOptions) MarshalJSON

func (t *MessageOptions) MarshalJSON() (b []byte, err error)

func (*MessageOptions) MessageOptions

func (t *MessageOptions) MessageOptions() *descriptorpb.MessageOptions

func (*MessageOptions) MessageSetWireFormat

func (t *MessageOptions) MessageSetWireFormat() bool

func (*MessageOptions) NoStandardDescriptorAccessor

func (t *MessageOptions) NoStandardDescriptorAccessor() bool

func (*MessageOptions) Parent

func (t *MessageOptions) Parent() DescriptorCommon

func (*MessageOptions) PbDescriptor

func (t *MessageOptions) PbDescriptor() *descriptorpb.MessageOptions

func (*MessageOptions) UninterpretedOption

func (t *MessageOptions) UninterpretedOption() []*UninterpretedOption

type MethodDescriptorProto

type MethodDescriptorProto struct {
	// contains filtered or unexported fields
}

func (*MethodDescriptorProto) ClientStreaming

func (t *MethodDescriptorProto) ClientStreaming() bool

func (*MethodDescriptorProto) Comments

func (*MethodDescriptorProto) Empty

func (t *MethodDescriptorProto) Empty() bool

func (*MethodDescriptorProto) File

func (*MethodDescriptorProto) GetClientStreaming

func (t *MethodDescriptorProto) GetClientStreaming() (ret bool)

func (*MethodDescriptorProto) GetInputType

func (t *MethodDescriptorProto) GetInputType() (ret string)

func (*MethodDescriptorProto) GetName

func (t *MethodDescriptorProto) GetName() (ret string)

func (*MethodDescriptorProto) GetOptions

func (t *MethodDescriptorProto) GetOptions() (ret *MethodOptions)

func (*MethodDescriptorProto) GetOutputType

func (t *MethodDescriptorProto) GetOutputType() (ret string)

func (*MethodDescriptorProto) GetServerStreaming

func (t *MethodDescriptorProto) GetServerStreaming() (ret bool)

func (*MethodDescriptorProto) Index

func (t *MethodDescriptorProto) Index() int

func (*MethodDescriptorProto) InputType

func (t *MethodDescriptorProto) InputType() string

func (*MethodDescriptorProto) IsTopLevel

func (t *MethodDescriptorProto) IsTopLevel() bool

implement DescriptorCommon.IsTopLevel

func (*MethodDescriptorProto) LocationPath

func (t *MethodDescriptorProto) LocationPath() LocationPath

func (*MethodDescriptorProto) MarshalJSON

func (t *MethodDescriptorProto) MarshalJSON() (b []byte, err error)

func (*MethodDescriptorProto) MethodDescriptorProto

func (t *MethodDescriptorProto) MethodDescriptorProto() *descriptorpb.MethodDescriptorProto

func (*MethodDescriptorProto) Name

func (t *MethodDescriptorProto) Name() string

func (*MethodDescriptorProto) Options

func (t *MethodDescriptorProto) Options() *MethodOptions

func (*MethodDescriptorProto) OutputType

func (t *MethodDescriptorProto) OutputType() string

func (*MethodDescriptorProto) Parent

func (*MethodDescriptorProto) PbDescriptor

func (*MethodDescriptorProto) ServerStreaming

func (t *MethodDescriptorProto) ServerStreaming() bool

func (*MethodDescriptorProto) Service

Method 所属的 Service

type MethodOptions

type MethodOptions struct {
	// contains filtered or unexported fields
}

func (*MethodOptions) Comments

func (t *MethodOptions) Comments() *SourceCodeInfo_Location

func (*MethodOptions) Deprecated

func (t *MethodOptions) Deprecated() bool

func (*MethodOptions) Empty

func (t *MethodOptions) Empty() bool

func (*MethodOptions) File

func (*MethodOptions) GetDeprecated

func (t *MethodOptions) GetDeprecated() (ret bool)

func (*MethodOptions) GetIdempotencyLevel

func (t *MethodOptions) GetIdempotencyLevel() (ret MethodOptions_IdempotencyLevel)

func (*MethodOptions) GetUninterpretedOption

func (t *MethodOptions) GetUninterpretedOption() (ret []*UninterpretedOption)

func (*MethodOptions) IdempotencyLevel

func (t *MethodOptions) IdempotencyLevel() MethodOptions_IdempotencyLevel

func (*MethodOptions) Index

func (t *MethodOptions) Index() int

func (*MethodOptions) IsTopLevel

func (t *MethodOptions) IsTopLevel() bool

implement DescriptorCommon.IsTopLevel

func (*MethodOptions) LocationPath

func (t *MethodOptions) LocationPath() LocationPath

func (*MethodOptions) MarshalJSON

func (t *MethodOptions) MarshalJSON() (b []byte, err error)

func (*MethodOptions) MethodOptions

func (t *MethodOptions) MethodOptions() *descriptorpb.MethodOptions

func (*MethodOptions) Parent

func (t *MethodOptions) Parent() DescriptorCommon

func (*MethodOptions) PbDescriptor

func (t *MethodOptions) PbDescriptor() *descriptorpb.MethodOptions

func (*MethodOptions) UninterpretedOption

func (t *MethodOptions) UninterpretedOption() []*UninterpretedOption

type MethodOptions_IdempotencyLevel

type MethodOptions_IdempotencyLevel = descriptorpb.MethodOptions_IdempotencyLevel

MethodOptions_IdempotencyLevel

See descriptorpb.MethodOptions_IdempotencyLevel

Is this method side-effect-free (or safe in HTTP parlance), or idempotent, or neither? HTTP based RPC implementation may choose GET verb for safe methods, and PUT verb for idempotent methods instead of the default POST.

type NamedDescriptor

type NamedDescriptor interface {
	GetName() string
	DescriptorCommon
}

type Nestable

type Nestable interface {
	NamedDescriptor

	// 是否嵌套的
	IsNested() bool
	// 所属的message
	ParentMessage() *DescriptorProto
}

可嵌套在message中的结构

See DescriptorProto / EnumDescriptorProto
See NestableDescriptors

type OneofDescriptorProto

type OneofDescriptorProto struct {
	// contains filtered or unexported fields
}

func (*OneofDescriptorProto) Comments

func (*OneofDescriptorProto) Empty

func (t *OneofDescriptorProto) Empty() bool

func (*OneofDescriptorProto) File

func (*OneofDescriptorProto) GetName

func (t *OneofDescriptorProto) GetName() (ret string)

func (*OneofDescriptorProto) GetOptions

func (t *OneofDescriptorProto) GetOptions() (ret *OneofOptions)

func (*OneofDescriptorProto) Index

func (t *OneofDescriptorProto) Index() int

func (*OneofDescriptorProto) IsTopLevel

func (t *OneofDescriptorProto) IsTopLevel() bool

implement DescriptorCommon.IsTopLevel

func (*OneofDescriptorProto) LocationPath

func (t *OneofDescriptorProto) LocationPath() LocationPath

func (*OneofDescriptorProto) MarshalJSON

func (t *OneofDescriptorProto) MarshalJSON() (b []byte, err error)

func (*OneofDescriptorProto) Name

func (t *OneofDescriptorProto) Name() string

func (*OneofDescriptorProto) OneofDescriptorProto

func (t *OneofDescriptorProto) OneofDescriptorProto() *descriptorpb.OneofDescriptorProto

func (*OneofDescriptorProto) Options

func (t *OneofDescriptorProto) Options() *OneofOptions

func (*OneofDescriptorProto) Parent

func (*OneofDescriptorProto) PbDescriptor

type OneofOptions

type OneofOptions struct {
	// contains filtered or unexported fields
}

func (*OneofOptions) Comments

func (t *OneofOptions) Comments() *SourceCodeInfo_Location

func (*OneofOptions) Empty

func (t *OneofOptions) Empty() bool

func (*OneofOptions) File

func (t *OneofOptions) File() *FileDescriptorProto

func (*OneofOptions) GetUninterpretedOption

func (t *OneofOptions) GetUninterpretedOption() (ret []*UninterpretedOption)

func (*OneofOptions) Index

func (t *OneofOptions) Index() int

func (*OneofOptions) IsTopLevel

func (t *OneofOptions) IsTopLevel() bool

implement DescriptorCommon.IsTopLevel

func (*OneofOptions) LocationPath

func (t *OneofOptions) LocationPath() LocationPath

func (*OneofOptions) MarshalJSON

func (t *OneofOptions) MarshalJSON() (b []byte, err error)

func (*OneofOptions) OneofOptions

func (t *OneofOptions) OneofOptions() *descriptorpb.OneofOptions

func (*OneofOptions) Parent

func (t *OneofOptions) Parent() DescriptorCommon

func (*OneofOptions) PbDescriptor

func (t *OneofOptions) PbDescriptor() *descriptorpb.OneofOptions

func (*OneofOptions) UninterpretedOption

func (t *OneofOptions) UninterpretedOption() []*UninterpretedOption

type PbTypeInfo

type PbTypeInfo struct {
	// contains filtered or unexported fields
}

func (*PbTypeInfo) FullTypeName

func (t *PbTypeInfo) FullTypeName() string

FullTypeName 完整的类型名称,如:.g

func (PbTypeInfo) Package

func (t PbTypeInfo) Package() string

func (*PbTypeInfo) TypeNames

func (t *PbTypeInfo) TypeNames() []string

type ProtoType

type ProtoType interface {
	NamedDescriptor
	// proto type 信息
	ProtoType() *PbTypeInfo
}

proto的基本类型信息. 目前有以下struct实现了此interface - message: DescriptorProto - enum: EnumDescriptorProto See ProtoTypeDescriptors

type ServiceDescriptorProto

type ServiceDescriptorProto struct {
	// contains filtered or unexported fields
}

func (*ServiceDescriptorProto) Comments

func (*ServiceDescriptorProto) Empty

func (t *ServiceDescriptorProto) Empty() bool

func (*ServiceDescriptorProto) File

func (*ServiceDescriptorProto) GetMethod

func (t *ServiceDescriptorProto) GetMethod() (ret []*MethodDescriptorProto)

func (*ServiceDescriptorProto) GetName

func (t *ServiceDescriptorProto) GetName() (ret string)

func (*ServiceDescriptorProto) GetOptions

func (t *ServiceDescriptorProto) GetOptions() (ret *ServiceOptions)

func (*ServiceDescriptorProto) Index

func (t *ServiceDescriptorProto) Index() int

func (*ServiceDescriptorProto) IsTopLevel

func (t *ServiceDescriptorProto) IsTopLevel() bool

implement DescriptorCommon.IsTopLevel

func (*ServiceDescriptorProto) LocationPath

func (t *ServiceDescriptorProto) LocationPath() LocationPath

func (*ServiceDescriptorProto) MarshalJSON

func (t *ServiceDescriptorProto) MarshalJSON() (b []byte, err error)

func (*ServiceDescriptorProto) Method

func (*ServiceDescriptorProto) Name

func (t *ServiceDescriptorProto) Name() string

func (*ServiceDescriptorProto) Options

func (t *ServiceDescriptorProto) Options() *ServiceOptions

func (*ServiceDescriptorProto) Parent

func (*ServiceDescriptorProto) PbDescriptor

func (*ServiceDescriptorProto) ServiceDescriptorProto

func (t *ServiceDescriptorProto) ServiceDescriptorProto() *descriptorpb.ServiceDescriptorProto

type ServiceOptions

type ServiceOptions struct {
	// contains filtered or unexported fields
}

func (*ServiceOptions) Comments

func (t *ServiceOptions) Comments() *SourceCodeInfo_Location

func (*ServiceOptions) Deprecated

func (t *ServiceOptions) Deprecated() bool

func (*ServiceOptions) Empty

func (t *ServiceOptions) Empty() bool

func (*ServiceOptions) File

func (*ServiceOptions) GetDeprecated

func (t *ServiceOptions) GetDeprecated() (ret bool)

func (*ServiceOptions) GetUninterpretedOption

func (t *ServiceOptions) GetUninterpretedOption() (ret []*UninterpretedOption)

func (*ServiceOptions) Index

func (t *ServiceOptions) Index() int

func (*ServiceOptions) IsTopLevel

func (t *ServiceOptions) IsTopLevel() bool

implement DescriptorCommon.IsTopLevel

func (*ServiceOptions) LocationPath

func (t *ServiceOptions) LocationPath() LocationPath

func (*ServiceOptions) MarshalJSON

func (t *ServiceOptions) MarshalJSON() (b []byte, err error)

func (*ServiceOptions) Parent

func (t *ServiceOptions) Parent() DescriptorCommon

func (*ServiceOptions) PbDescriptor

func (t *ServiceOptions) PbDescriptor() *descriptorpb.ServiceOptions

func (*ServiceOptions) ServiceOptions

func (t *ServiceOptions) ServiceOptions() *descriptorpb.ServiceOptions

func (*ServiceOptions) UninterpretedOption

func (t *ServiceOptions) UninterpretedOption() []*UninterpretedOption

type SourceCodeInfo

type SourceCodeInfo struct {
	// contains filtered or unexported fields
}

func (*SourceCodeInfo) Comments

func (t *SourceCodeInfo) Comments() *SourceCodeInfo_Location

func (*SourceCodeInfo) Empty

func (t *SourceCodeInfo) Empty() bool

func (*SourceCodeInfo) File

func (*SourceCodeInfo) GetLocation

func (t *SourceCodeInfo) GetLocation() (ret []*SourceCodeInfo_Location)

func (*SourceCodeInfo) Index

func (t *SourceCodeInfo) Index() int

func (*SourceCodeInfo) IsTopLevel

func (t *SourceCodeInfo) IsTopLevel() bool

implement DescriptorCommon.IsTopLevel

func (*SourceCodeInfo) Location

func (t *SourceCodeInfo) Location() []*SourceCodeInfo_Location

func (*SourceCodeInfo) LocationPath

func (t *SourceCodeInfo) LocationPath() LocationPath

func (*SourceCodeInfo) MarshalJSON

func (t *SourceCodeInfo) MarshalJSON() (b []byte, err error)

func (*SourceCodeInfo) Parent

func (t *SourceCodeInfo) Parent() DescriptorCommon

func (*SourceCodeInfo) PbDescriptor

func (t *SourceCodeInfo) PbDescriptor() *descriptorpb.SourceCodeInfo

func (*SourceCodeInfo) SourceCodeInfo

func (t *SourceCodeInfo) SourceCodeInfo() *descriptorpb.SourceCodeInfo

type SourceCodeInfo_Location

type SourceCodeInfo_Location struct {
	// contains filtered or unexported fields
}

func (*SourceCodeInfo_Location) Comments

func (*SourceCodeInfo_Location) Empty

func (t *SourceCodeInfo_Location) Empty() bool

func (*SourceCodeInfo_Location) File

func (*SourceCodeInfo_Location) GetLeadingComments

func (t *SourceCodeInfo_Location) GetLeadingComments() (ret string)

func (*SourceCodeInfo_Location) GetLeadingDetachedComments

func (t *SourceCodeInfo_Location) GetLeadingDetachedComments() (ret []string)

func (*SourceCodeInfo_Location) GetPath

func (t *SourceCodeInfo_Location) GetPath() (ret []int32)

func (*SourceCodeInfo_Location) GetSpan

func (t *SourceCodeInfo_Location) GetSpan() (ret []int32)

func (*SourceCodeInfo_Location) GetTrailingComments

func (t *SourceCodeInfo_Location) GetTrailingComments() (ret string)

func (*SourceCodeInfo_Location) Index

func (t *SourceCodeInfo_Location) Index() int

func (*SourceCodeInfo_Location) IsTopLevel

func (t *SourceCodeInfo_Location) IsTopLevel() bool

implement DescriptorCommon.IsTopLevel

func (*SourceCodeInfo_Location) LeadingComments

func (t *SourceCodeInfo_Location) LeadingComments() string

func (*SourceCodeInfo_Location) LeadingDetachedComments

func (t *SourceCodeInfo_Location) LeadingDetachedComments() []string

func (*SourceCodeInfo_Location) LocationPath

func (t *SourceCodeInfo_Location) LocationPath() LocationPath

func (*SourceCodeInfo_Location) MarshalJSON

func (t *SourceCodeInfo_Location) MarshalJSON() (b []byte, err error)

func (*SourceCodeInfo_Location) Parent

func (*SourceCodeInfo_Location) Path

func (t *SourceCodeInfo_Location) Path() []int32

func (*SourceCodeInfo_Location) PbDescriptor

func (*SourceCodeInfo_Location) SourceCodeInfo_Location

func (t *SourceCodeInfo_Location) SourceCodeInfo_Location() *descriptorpb.SourceCodeInfo_Location

func (*SourceCodeInfo_Location) Span

func (t *SourceCodeInfo_Location) Span() []int32

func (*SourceCodeInfo_Location) String

func (t *SourceCodeInfo_Location) String() string

默认的注释

func (*SourceCodeInfo_Location) TrailingComments

func (t *SourceCodeInfo_Location) TrailingComments() string

type UninterpretedOption

type UninterpretedOption struct {
	// contains filtered or unexported fields
}

func (*UninterpretedOption) AggregateValue

func (t *UninterpretedOption) AggregateValue() string

func (*UninterpretedOption) Comments

func (*UninterpretedOption) DoubleValue

func (t *UninterpretedOption) DoubleValue() float64

func (*UninterpretedOption) Empty

func (t *UninterpretedOption) Empty() bool

func (*UninterpretedOption) File

func (*UninterpretedOption) GetAggregateValue

func (t *UninterpretedOption) GetAggregateValue() (ret string)

func (*UninterpretedOption) GetDoubleValue

func (t *UninterpretedOption) GetDoubleValue() (ret float64)

func (*UninterpretedOption) GetIdentifierValue

func (t *UninterpretedOption) GetIdentifierValue() (ret string)

func (*UninterpretedOption) GetName

func (t *UninterpretedOption) GetName() (ret []*UninterpretedOption_NamePart)

func (*UninterpretedOption) GetNegativeIntValue

func (t *UninterpretedOption) GetNegativeIntValue() (ret int64)

func (*UninterpretedOption) GetPositiveIntValue

func (t *UninterpretedOption) GetPositiveIntValue() (ret uint64)

func (*UninterpretedOption) GetStringValue

func (t *UninterpretedOption) GetStringValue() (ret []byte)

func (*UninterpretedOption) IdentifierValue

func (t *UninterpretedOption) IdentifierValue() string

func (*UninterpretedOption) Index

func (t *UninterpretedOption) Index() int

func (*UninterpretedOption) IsTopLevel

func (t *UninterpretedOption) IsTopLevel() bool

implement DescriptorCommon.IsTopLevel

func (*UninterpretedOption) LocationPath

func (t *UninterpretedOption) LocationPath() LocationPath

func (*UninterpretedOption) MarshalJSON

func (t *UninterpretedOption) MarshalJSON() (b []byte, err error)

func (*UninterpretedOption) Name

func (*UninterpretedOption) NegativeIntValue

func (t *UninterpretedOption) NegativeIntValue() int64

func (*UninterpretedOption) Parent

func (*UninterpretedOption) PbDescriptor

func (*UninterpretedOption) PositiveIntValue

func (t *UninterpretedOption) PositiveIntValue() uint64

func (*UninterpretedOption) StringValue

func (t *UninterpretedOption) StringValue() []byte

func (*UninterpretedOption) UninterpretedOption

func (t *UninterpretedOption) UninterpretedOption() *descriptorpb.UninterpretedOption

type UninterpretedOption_NamePart

type UninterpretedOption_NamePart struct {
	// contains filtered or unexported fields
}

func (*UninterpretedOption_NamePart) Comments

func (*UninterpretedOption_NamePart) Empty

func (*UninterpretedOption_NamePart) File

func (*UninterpretedOption_NamePart) GetIsExtension

func (t *UninterpretedOption_NamePart) GetIsExtension() (ret bool)

func (*UninterpretedOption_NamePart) GetNamePart

func (t *UninterpretedOption_NamePart) GetNamePart() (ret string)

func (*UninterpretedOption_NamePart) Index

func (t *UninterpretedOption_NamePart) Index() int

func (*UninterpretedOption_NamePart) IsExtension

func (t *UninterpretedOption_NamePart) IsExtension() bool

func (*UninterpretedOption_NamePart) IsTopLevel

func (t *UninterpretedOption_NamePart) IsTopLevel() bool

implement DescriptorCommon.IsTopLevel

func (*UninterpretedOption_NamePart) LocationPath

func (t *UninterpretedOption_NamePart) LocationPath() LocationPath

func (*UninterpretedOption_NamePart) MarshalJSON

func (t *UninterpretedOption_NamePart) MarshalJSON() (b []byte, err error)

func (*UninterpretedOption_NamePart) NamePart

func (t *UninterpretedOption_NamePart) NamePart() string

func (*UninterpretedOption_NamePart) Parent

func (*UninterpretedOption_NamePart) PbDescriptor

func (*UninterpretedOption_NamePart) UninterpretedOption_NamePart

func (t *UninterpretedOption_NamePart) UninterpretedOption_NamePart() *descriptorpb.UninterpretedOption_NamePart

Jump to

Keyboard shortcuts

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