Documentation ¶
Overview ¶
Package protobuf generates Protocol Buffers schema from the intermediate representation passed by the transpiler.
Index ¶
- func FieldTypeBool() *descriptorpb.FieldDescriptorProto_Type
- func FieldTypeBytes() *descriptorpb.FieldDescriptorProto_Type
- func FieldTypeDouble() *descriptorpb.FieldDescriptorProto_Type
- func FieldTypeEnum() *descriptorpb.FieldDescriptorProto_Type
- func FieldTypeFixed32() *descriptorpb.FieldDescriptorProto_Type
- func FieldTypeFixed64() *descriptorpb.FieldDescriptorProto_Type
- func FieldTypeFloat() *descriptorpb.FieldDescriptorProto_Type
- func FieldTypeInt32() *descriptorpb.FieldDescriptorProto_Type
- func FieldTypeInt64() *descriptorpb.FieldDescriptorProto_Type
- func FieldTypeMessage() *descriptorpb.FieldDescriptorProto_Type
- func FieldTypeSfixed32() *descriptorpb.FieldDescriptorProto_Type
- func FieldTypeSfixed64() *descriptorpb.FieldDescriptorProto_Type
- func FieldTypeSint32() *descriptorpb.FieldDescriptorProto_Type
- func FieldTypeSint64() *descriptorpb.FieldDescriptorProto_Type
- func FieldTypeString() *descriptorpb.FieldDescriptorProto_Type
- func FieldTypeUint32() *descriptorpb.FieldDescriptorProto_Type
- func FieldTypeUint64() *descriptorpb.FieldDescriptorProto_Type
- func PopulateSourceInfoMap(fd *descriptorpb.FileDescriptorProto, m SourceInfoMap)
- func RecomputeSourceInfo(c SourceInfoComputer)
- type Comment
- type EnumDescriptorProto
- func (ed *EnumDescriptorProto) AddLeadingComment(fn, leading string) *EnumDescriptorProto
- func (ed *EnumDescriptorProto) AddLeadingDetachedComment(leadingDetached []string) *EnumDescriptorProto
- func (ed *EnumDescriptorProto) AddTrailingComment(trailing string) *EnumDescriptorProto
- func (ed *EnumDescriptorProto) AddValue(value *EnumValueDescriptorProto) *EnumDescriptorProto
- func (ed *EnumDescriptorProto) Build() *descriptorpb.EnumDescriptorProto
- func (ed *EnumDescriptorProto) GetComment() Comment
- func (ed *EnumDescriptorProto) GetName() string
- func (ed *EnumDescriptorProto) GetValue() []*descriptorpb.EnumValueDescriptorProto
- type EnumValueDescriptorProto
- type EnumValues
- type FieldDescriptorProto
- func (fid *FieldDescriptorProto) AddLeadingComment(fn, leading string) *FieldDescriptorProto
- func (fid *FieldDescriptorProto) AddLeadingDetachedComment(leadingDetached []string) *FieldDescriptorProto
- func (fid *FieldDescriptorProto) AddTrailingComment(trailing string) *FieldDescriptorProto
- func (fid *FieldDescriptorProto) Build() *descriptorpb.FieldDescriptorProto
- func (fid *FieldDescriptorProto) GetComment() *Comment
- func (fid *FieldDescriptorProto) GetName() string
- func (fid *FieldDescriptorProto) GetNumber() int32
- func (fid *FieldDescriptorProto) GetTypeName() *string
- func (fid *FieldDescriptorProto) HasComment() bool
- func (fid *FieldDescriptorProto) SetFieldOption(fieldOptions *descriptorpb.FieldOptions) *FieldDescriptorProto
- func (fid *FieldDescriptorProto) SetJsonName(jsonName string) *FieldDescriptorProto
- func (fid *FieldDescriptorProto) SetNumber() *FieldDescriptorProto
- func (fid *FieldDescriptorProto) SetOneofIndex(idx int32) *FieldDescriptorProto
- func (fid *FieldDescriptorProto) SetProto3Optional() *FieldDescriptorProto
- func (fid *FieldDescriptorProto) SetRepeated() *FieldDescriptorProto
- func (fid *FieldDescriptorProto) SetTypeName(name string) *FieldDescriptorProto
- type FileDescriptorProto
- func (fd *FileDescriptorProto) AddComponent(name string)
- func (fd *FileDescriptorProto) AddDependency(deps string) *FileDescriptorProto
- func (fd *FileDescriptorProto) AddEnum(enum *EnumDescriptorProto) *FileDescriptorProto
- func (fd *FileDescriptorProto) AddExtension(ext *FieldDescriptorProto) *FileDescriptorProto
- func (fd *FileDescriptorProto) AddMessage(msg *MessageDescriptorProto) *FileDescriptorProto
- func (fd *FileDescriptorProto) AddMessageDescriptor(desc *descriptorpb.DescriptorProto) *FileDescriptorProto
- func (fd *FileDescriptorProto) AddPackageLeadingComments(comments string)
- func (fd *FileDescriptorProto) AddService(service *ServiceDescriptorProto) *FileDescriptorProto
- func (fd *FileDescriptorProto) AddSourceCodeInfoLocation(loc *descriptorpb.SourceCodeInfo_Location) *FileDescriptorProto
- func (fd *FileDescriptorProto) Build() *descriptorpb.FileDescriptorProto
- func (fd *FileDescriptorProto) GetDependency() []string
- func (fd *FileDescriptorProto) GetName() string
- func (fd *FileDescriptorProto) HasComponent(name string) bool
- func (fd *FileDescriptorProto) SetName(name string)
- func (fd *FileDescriptorProto) SetPackage(fqn string)
- type MessageDescriptorProto
- func (md *MessageDescriptorProto) AddEnumType(enum *EnumDescriptorProto) *MessageDescriptorProto
- func (md *MessageDescriptorProto) AddExtension(ext *FieldDescriptorProto) *MessageDescriptorProto
- func (md *MessageDescriptorProto) AddField(field *FieldDescriptorProto) *MessageDescriptorProto
- func (md *MessageDescriptorProto) AddLeadingComment(fn, leading string) *MessageDescriptorProto
- func (md *MessageDescriptorProto) AddLeadingDetachedComment(leadingDetached []string) *MessageDescriptorProto
- func (md *MessageDescriptorProto) AddNestedMessage(nested *MessageDescriptorProto) *MessageDescriptorProto
- func (md *MessageDescriptorProto) AddOneof(oneof *OneofDescriptorProto) *MessageDescriptorProto
- func (md *MessageDescriptorProto) AddTrailingComment(trailing string) *MessageDescriptorProto
- func (md *MessageDescriptorProto) Build() *descriptorpb.DescriptorProto
- func (md *MessageDescriptorProto) GetComment() *Comment
- func (md *MessageDescriptorProto) GetFieldByName(name string) *FieldDescriptorProto
- func (md *MessageDescriptorProto) GetFieldLocations() []*descriptorpb.SourceCodeInfo_Location
- func (md *MessageDescriptorProto) GetFieldOrder() []string
- func (md *MessageDescriptorProto) GetFieldType() *descriptorpb.FieldDescriptorProto_Type
- func (md *MessageDescriptorProto) GetName() string
- func (md *MessageDescriptorProto) GetNestedMessages() []string
- func (md *MessageDescriptorProto) GetOneofIndex() int32
- func (md *MessageDescriptorProto) HasNestedMessage(nested string) bool
- func (md *MessageDescriptorProto) IsEmptyField() bool
- func (md *MessageDescriptorProto) SetDeprecated(deprecated bool) *MessageDescriptorProto
- func (md *MessageDescriptorProto) SetExtensionRange(ranges ...*descriptorpb.DescriptorProto_ExtensionRange) *MessageDescriptorProto
- func (md *MessageDescriptorProto) SetMapEntry(mapEntry bool) *MessageDescriptorProto
- func (md *MessageDescriptorProto) SetMessageOptions(options *descriptorpb.MessageOptions) *MessageDescriptorProto
- func (md *MessageDescriptorProto) SetMessageSetWireFormat(messageSetWireFormat bool) *MessageDescriptorProto
- func (md *MessageDescriptorProto) SetName(name string) *MessageDescriptorProto
- func (md *MessageDescriptorProto) SetNoStandardDescriptorAccessor(noStandardDescriptorAccessor bool) *MessageDescriptorProto
- func (md *MessageDescriptorProto) SetReservedRange(reservedRange ...*descriptorpb.DescriptorProto_ReservedRange) *MessageDescriptorProto
- func (md *MessageDescriptorProto) SortField(order []string) *MessageDescriptorProto
- type MethodDescriptorProto
- func (sd *MethodDescriptorProto) AddLeadingComment(fn, leading string) *MethodDescriptorProto
- func (sd *MethodDescriptorProto) AddLeadingDetachedComment(leadingDetached []string) *MethodDescriptorProto
- func (sd *MethodDescriptorProto) AddTrailingComment(trailing string) *MethodDescriptorProto
- func (sd *MethodDescriptorProto) Build() *descriptorpb.MethodDescriptorProto
- func (sd *MethodDescriptorProto) GetComment() *Comment
- func (sd *MethodDescriptorProto) GetName() string
- func (sd *MethodDescriptorProto) SetMethodOptions(options *descriptorpb.MethodOptions) *MethodDescriptorProto
- type OneofDescriptorProto
- type ServiceDescriptorProto
- func (sd *ServiceDescriptorProto) AddLeadingComment(fn, leading string) *ServiceDescriptorProto
- func (sd *ServiceDescriptorProto) AddLeadingDetachedComment(leadingDetached []string) *ServiceDescriptorProto
- func (sd *ServiceDescriptorProto) AddMethod(method *MethodDescriptorProto) *ServiceDescriptorProto
- func (sd *ServiceDescriptorProto) AddTrailingComment(trailing string) *ServiceDescriptorProto
- func (sd *ServiceDescriptorProto) Build() *descriptorpb.ServiceDescriptorProto
- func (sd *ServiceDescriptorProto) GetComment() *Comment
- func (sd *ServiceDescriptorProto) GetName() string
- func (sd *ServiceDescriptorProto) SetServiceOptions(options *descriptorpb.ServiceOptions) *ServiceDescriptorProto
- type SourceInfoComputeFunc
- type SourceInfoComputer
- type SourceInfoMap
- func (m SourceInfoMap) Add(path []int32, loc *descriptorpb.SourceCodeInfo_Location)
- func (m SourceInfoMap) Get(path []int32) *descriptorpb.SourceCodeInfo_Location
- func (m SourceInfoMap) GetAll(path []int32) []*descriptorpb.SourceCodeInfo_Location
- func (m SourceInfoMap) PutIfAbsent(path []int32, loc *descriptorpb.SourceCodeInfo_Location) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FieldTypeBool ¶
func FieldTypeBool() *descriptorpb.FieldDescriptorProto_Type
func FieldTypeBytes ¶
func FieldTypeBytes() *descriptorpb.FieldDescriptorProto_Type
func FieldTypeDouble ¶
func FieldTypeDouble() *descriptorpb.FieldDescriptorProto_Type
func FieldTypeEnum ¶
func FieldTypeEnum() *descriptorpb.FieldDescriptorProto_Type
func FieldTypeFixed32 ¶
func FieldTypeFixed32() *descriptorpb.FieldDescriptorProto_Type
func FieldTypeFixed64 ¶
func FieldTypeFixed64() *descriptorpb.FieldDescriptorProto_Type
func FieldTypeFloat ¶
func FieldTypeFloat() *descriptorpb.FieldDescriptorProto_Type
func FieldTypeInt32 ¶
func FieldTypeInt32() *descriptorpb.FieldDescriptorProto_Type
func FieldTypeInt64 ¶
func FieldTypeInt64() *descriptorpb.FieldDescriptorProto_Type
func FieldTypeMessage ¶
func FieldTypeMessage() *descriptorpb.FieldDescriptorProto_Type
func FieldTypeSfixed32 ¶
func FieldTypeSfixed32() *descriptorpb.FieldDescriptorProto_Type
func FieldTypeSfixed64 ¶
func FieldTypeSfixed64() *descriptorpb.FieldDescriptorProto_Type
func FieldTypeSint32 ¶
func FieldTypeSint32() *descriptorpb.FieldDescriptorProto_Type
func FieldTypeSint64 ¶
func FieldTypeSint64() *descriptorpb.FieldDescriptorProto_Type
func FieldTypeString ¶
func FieldTypeString() *descriptorpb.FieldDescriptorProto_Type
func FieldTypeUint32 ¶
func FieldTypeUint32() *descriptorpb.FieldDescriptorProto_Type
func FieldTypeUint64 ¶
func FieldTypeUint64() *descriptorpb.FieldDescriptorProto_Type
func PopulateSourceInfoMap ¶
func PopulateSourceInfoMap(fd *descriptorpb.FileDescriptorProto, m SourceInfoMap)
PopulateSourceInfoMap populates the given SourceInfoMap with information from the given file descriptor.
func RecomputeSourceInfo ¶
func RecomputeSourceInfo(c SourceInfoComputer)
RecomputeSourceInfo is used to initiate recomputation of source info. This is is used by the protoparse package, after it interprets options.
Types ¶
type EnumDescriptorProto ¶
type EnumDescriptorProto struct {
// contains filtered or unexported fields
}
func NewEnumDescriptorProto ¶
func NewEnumDescriptorProto(name string) *EnumDescriptorProto
func (*EnumDescriptorProto) AddLeadingComment ¶
func (ed *EnumDescriptorProto) AddLeadingComment(fn, leading string) *EnumDescriptorProto
func (*EnumDescriptorProto) AddLeadingDetachedComment ¶
func (ed *EnumDescriptorProto) AddLeadingDetachedComment(leadingDetached []string) *EnumDescriptorProto
func (*EnumDescriptorProto) AddTrailingComment ¶
func (ed *EnumDescriptorProto) AddTrailingComment(trailing string) *EnumDescriptorProto
func (*EnumDescriptorProto) AddValue ¶
func (ed *EnumDescriptorProto) AddValue(value *EnumValueDescriptorProto) *EnumDescriptorProto
func (*EnumDescriptorProto) Build ¶
func (ed *EnumDescriptorProto) Build() *descriptorpb.EnumDescriptorProto
func (*EnumDescriptorProto) GetComment ¶
func (ed *EnumDescriptorProto) GetComment() Comment
func (*EnumDescriptorProto) GetName ¶
func (ed *EnumDescriptorProto) GetName() string
func (*EnumDescriptorProto) GetValue ¶
func (ed *EnumDescriptorProto) GetValue() []*descriptorpb.EnumValueDescriptorProto
type EnumValueDescriptorProto ¶
type EnumValueDescriptorProto struct {
// contains filtered or unexported fields
}
func NewEnumValueDescriptorProto ¶
func NewEnumValueDescriptorProto(name string, number int32) *EnumValueDescriptorProto
func (*EnumValueDescriptorProto) Build ¶
func (evd *EnumValueDescriptorProto) Build() *descriptorpb.EnumValueDescriptorProto
func (*EnumValueDescriptorProto) GetName ¶
func (evd *EnumValueDescriptorProto) GetName() string
func (*EnumValueDescriptorProto) SetDeprecated ¶
func (evd *EnumValueDescriptorProto) SetDeprecated() *EnumValueDescriptorProto
type EnumValues ¶
type EnumValues []*EnumValueDescriptorProto
func (EnumValues) Build ¶
func (evs EnumValues) Build() []*descriptorpb.EnumValueDescriptorProto
type FieldDescriptorProto ¶
type FieldDescriptorProto struct {
// contains filtered or unexported fields
}
func NewFieldDescriptorProto ¶
func NewFieldDescriptorProto(name string, fieldType *descriptorpb.FieldDescriptorProto_Type) *FieldDescriptorProto
func (*FieldDescriptorProto) AddLeadingComment ¶
func (fid *FieldDescriptorProto) AddLeadingComment(fn, leading string) *FieldDescriptorProto
func (*FieldDescriptorProto) AddLeadingDetachedComment ¶
func (fid *FieldDescriptorProto) AddLeadingDetachedComment(leadingDetached []string) *FieldDescriptorProto
func (*FieldDescriptorProto) AddTrailingComment ¶
func (fid *FieldDescriptorProto) AddTrailingComment(trailing string) *FieldDescriptorProto
func (*FieldDescriptorProto) Build ¶
func (fid *FieldDescriptorProto) Build() *descriptorpb.FieldDescriptorProto
func (*FieldDescriptorProto) GetComment ¶
func (fid *FieldDescriptorProto) GetComment() *Comment
func (*FieldDescriptorProto) GetName ¶
func (fid *FieldDescriptorProto) GetName() string
func (*FieldDescriptorProto) GetNumber ¶
func (fid *FieldDescriptorProto) GetNumber() int32
func (*FieldDescriptorProto) GetTypeName ¶
func (fid *FieldDescriptorProto) GetTypeName() *string
func (*FieldDescriptorProto) HasComment ¶
func (fid *FieldDescriptorProto) HasComment() bool
func (*FieldDescriptorProto) SetFieldOption ¶
func (fid *FieldDescriptorProto) SetFieldOption(fieldOptions *descriptorpb.FieldOptions) *FieldDescriptorProto
func (*FieldDescriptorProto) SetJsonName ¶
func (fid *FieldDescriptorProto) SetJsonName(jsonName string) *FieldDescriptorProto
func (*FieldDescriptorProto) SetNumber ¶
func (fid *FieldDescriptorProto) SetNumber() *FieldDescriptorProto
func (*FieldDescriptorProto) SetOneofIndex ¶
func (fid *FieldDescriptorProto) SetOneofIndex(idx int32) *FieldDescriptorProto
func (*FieldDescriptorProto) SetProto3Optional ¶
func (fid *FieldDescriptorProto) SetProto3Optional() *FieldDescriptorProto
func (*FieldDescriptorProto) SetRepeated ¶
func (fid *FieldDescriptorProto) SetRepeated() *FieldDescriptorProto
func (*FieldDescriptorProto) SetTypeName ¶
func (fid *FieldDescriptorProto) SetTypeName(name string) *FieldDescriptorProto
type FileDescriptorProto ¶
type FileDescriptorProto struct {
// contains filtered or unexported fields
}
func NewFileDescriptorProto ¶
func NewFileDescriptorProto(fqn string) *FileDescriptorProto
func (*FileDescriptorProto) AddComponent ¶
func (fd *FileDescriptorProto) AddComponent(name string)
func (*FileDescriptorProto) AddDependency ¶
func (fd *FileDescriptorProto) AddDependency(deps string) *FileDescriptorProto
func (*FileDescriptorProto) AddEnum ¶
func (fd *FileDescriptorProto) AddEnum(enum *EnumDescriptorProto) *FileDescriptorProto
func (*FileDescriptorProto) AddExtension ¶
func (fd *FileDescriptorProto) AddExtension(ext *FieldDescriptorProto) *FileDescriptorProto
func (*FileDescriptorProto) AddMessage ¶
func (fd *FileDescriptorProto) AddMessage(msg *MessageDescriptorProto) *FileDescriptorProto
func (*FileDescriptorProto) AddMessageDescriptor ¶
func (fd *FileDescriptorProto) AddMessageDescriptor(desc *descriptorpb.DescriptorProto) *FileDescriptorProto
func (*FileDescriptorProto) AddPackageLeadingComments ¶
func (fd *FileDescriptorProto) AddPackageLeadingComments(comments string)
func (*FileDescriptorProto) AddService ¶
func (fd *FileDescriptorProto) AddService(service *ServiceDescriptorProto) *FileDescriptorProto
func (*FileDescriptorProto) AddSourceCodeInfoLocation ¶
func (fd *FileDescriptorProto) AddSourceCodeInfoLocation(loc *descriptorpb.SourceCodeInfo_Location) *FileDescriptorProto
func (*FileDescriptorProto) Build ¶
func (fd *FileDescriptorProto) Build() *descriptorpb.FileDescriptorProto
func (*FileDescriptorProto) GetDependency ¶
func (fd *FileDescriptorProto) GetDependency() []string
func (*FileDescriptorProto) GetName ¶
func (fd *FileDescriptorProto) GetName() string
func (*FileDescriptorProto) HasComponent ¶
func (fd *FileDescriptorProto) HasComponent(name string) bool
func (*FileDescriptorProto) SetName ¶
func (fd *FileDescriptorProto) SetName(name string)
func (*FileDescriptorProto) SetPackage ¶
func (fd *FileDescriptorProto) SetPackage(fqn string)
type MessageDescriptorProto ¶
type MessageDescriptorProto struct {
// contains filtered or unexported fields
}
func NewMessageDescriptorProto ¶
func NewMessageDescriptorProto(name string) *MessageDescriptorProto
func (*MessageDescriptorProto) AddEnumType ¶
func (md *MessageDescriptorProto) AddEnumType(enum *EnumDescriptorProto) *MessageDescriptorProto
func (*MessageDescriptorProto) AddExtension ¶
func (md *MessageDescriptorProto) AddExtension(ext *FieldDescriptorProto) *MessageDescriptorProto
func (*MessageDescriptorProto) AddField ¶
func (md *MessageDescriptorProto) AddField(field *FieldDescriptorProto) *MessageDescriptorProto
func (*MessageDescriptorProto) AddLeadingComment ¶
func (md *MessageDescriptorProto) AddLeadingComment(fn, leading string) *MessageDescriptorProto
func (*MessageDescriptorProto) AddLeadingDetachedComment ¶
func (md *MessageDescriptorProto) AddLeadingDetachedComment(leadingDetached []string) *MessageDescriptorProto
func (*MessageDescriptorProto) AddNestedMessage ¶
func (md *MessageDescriptorProto) AddNestedMessage(nested *MessageDescriptorProto) *MessageDescriptorProto
func (*MessageDescriptorProto) AddOneof ¶
func (md *MessageDescriptorProto) AddOneof(oneof *OneofDescriptorProto) *MessageDescriptorProto
func (*MessageDescriptorProto) AddTrailingComment ¶
func (md *MessageDescriptorProto) AddTrailingComment(trailing string) *MessageDescriptorProto
func (*MessageDescriptorProto) Build ¶
func (md *MessageDescriptorProto) Build() *descriptorpb.DescriptorProto
func (*MessageDescriptorProto) GetComment ¶
func (md *MessageDescriptorProto) GetComment() *Comment
func (*MessageDescriptorProto) GetFieldByName ¶
func (md *MessageDescriptorProto) GetFieldByName(name string) *FieldDescriptorProto
func (*MessageDescriptorProto) GetFieldLocations ¶
func (md *MessageDescriptorProto) GetFieldLocations() []*descriptorpb.SourceCodeInfo_Location
func (*MessageDescriptorProto) GetFieldOrder ¶
func (md *MessageDescriptorProto) GetFieldOrder() []string
func (*MessageDescriptorProto) GetFieldType ¶
func (md *MessageDescriptorProto) GetFieldType() *descriptorpb.FieldDescriptorProto_Type
func (*MessageDescriptorProto) GetName ¶
func (md *MessageDescriptorProto) GetName() string
func (*MessageDescriptorProto) GetNestedMessages ¶
func (md *MessageDescriptorProto) GetNestedMessages() []string
func (*MessageDescriptorProto) GetOneofIndex ¶
func (md *MessageDescriptorProto) GetOneofIndex() int32
func (*MessageDescriptorProto) HasNestedMessage ¶
func (md *MessageDescriptorProto) HasNestedMessage(nested string) bool
func (*MessageDescriptorProto) IsEmptyField ¶
func (md *MessageDescriptorProto) IsEmptyField() bool
func (*MessageDescriptorProto) SetDeprecated ¶
func (md *MessageDescriptorProto) SetDeprecated(deprecated bool) *MessageDescriptorProto
func (*MessageDescriptorProto) SetExtensionRange ¶
func (md *MessageDescriptorProto) SetExtensionRange(ranges ...*descriptorpb.DescriptorProto_ExtensionRange) *MessageDescriptorProto
func (*MessageDescriptorProto) SetMapEntry ¶
func (md *MessageDescriptorProto) SetMapEntry(mapEntry bool) *MessageDescriptorProto
func (*MessageDescriptorProto) SetMessageOptions ¶
func (md *MessageDescriptorProto) SetMessageOptions(options *descriptorpb.MessageOptions) *MessageDescriptorProto
func (*MessageDescriptorProto) SetMessageSetWireFormat ¶
func (md *MessageDescriptorProto) SetMessageSetWireFormat(messageSetWireFormat bool) *MessageDescriptorProto
func (*MessageDescriptorProto) SetName ¶
func (md *MessageDescriptorProto) SetName(name string) *MessageDescriptorProto
func (*MessageDescriptorProto) SetNoStandardDescriptorAccessor ¶
func (md *MessageDescriptorProto) SetNoStandardDescriptorAccessor(noStandardDescriptorAccessor bool) *MessageDescriptorProto
func (*MessageDescriptorProto) SetReservedRange ¶
func (md *MessageDescriptorProto) SetReservedRange(reservedRange ...*descriptorpb.DescriptorProto_ReservedRange) *MessageDescriptorProto
func (*MessageDescriptorProto) SortField ¶
func (md *MessageDescriptorProto) SortField(order []string) *MessageDescriptorProto
type MethodDescriptorProto ¶
type MethodDescriptorProto struct {
// contains filtered or unexported fields
}
func NewMethodDescriptorProto ¶
func NewMethodDescriptorProto(name, input, output string) *MethodDescriptorProto
func (*MethodDescriptorProto) AddLeadingComment ¶
func (sd *MethodDescriptorProto) AddLeadingComment(fn, leading string) *MethodDescriptorProto
func (*MethodDescriptorProto) AddLeadingDetachedComment ¶
func (sd *MethodDescriptorProto) AddLeadingDetachedComment(leadingDetached []string) *MethodDescriptorProto
func (*MethodDescriptorProto) AddTrailingComment ¶
func (sd *MethodDescriptorProto) AddTrailingComment(trailing string) *MethodDescriptorProto
func (*MethodDescriptorProto) Build ¶
func (sd *MethodDescriptorProto) Build() *descriptorpb.MethodDescriptorProto
func (*MethodDescriptorProto) GetComment ¶
func (sd *MethodDescriptorProto) GetComment() *Comment
func (*MethodDescriptorProto) GetName ¶
func (sd *MethodDescriptorProto) GetName() string
func (*MethodDescriptorProto) SetMethodOptions ¶
func (sd *MethodDescriptorProto) SetMethodOptions(options *descriptorpb.MethodOptions) *MethodDescriptorProto
type OneofDescriptorProto ¶
type OneofDescriptorProto struct {
// contains filtered or unexported fields
}
func NewOneofDescriptorProto ¶
func NewOneofDescriptorProto(name string) *OneofDescriptorProto
func (*OneofDescriptorProto) Build ¶
func (md *OneofDescriptorProto) Build() *descriptorpb.OneofDescriptorProto
func (*OneofDescriptorProto) GetName ¶
func (md *OneofDescriptorProto) GetName() string
type ServiceDescriptorProto ¶
type ServiceDescriptorProto struct {
// contains filtered or unexported fields
}
func NewServiceDescriptorProto ¶
func NewServiceDescriptorProto(name string) *ServiceDescriptorProto
func (*ServiceDescriptorProto) AddLeadingComment ¶
func (sd *ServiceDescriptorProto) AddLeadingComment(fn, leading string) *ServiceDescriptorProto
func (*ServiceDescriptorProto) AddLeadingDetachedComment ¶
func (sd *ServiceDescriptorProto) AddLeadingDetachedComment(leadingDetached []string) *ServiceDescriptorProto
func (*ServiceDescriptorProto) AddMethod ¶
func (sd *ServiceDescriptorProto) AddMethod(method *MethodDescriptorProto) *ServiceDescriptorProto
func (*ServiceDescriptorProto) AddTrailingComment ¶
func (sd *ServiceDescriptorProto) AddTrailingComment(trailing string) *ServiceDescriptorProto
func (*ServiceDescriptorProto) Build ¶
func (sd *ServiceDescriptorProto) Build() *descriptorpb.ServiceDescriptorProto
func (*ServiceDescriptorProto) GetComment ¶
func (sd *ServiceDescriptorProto) GetComment() *Comment
func (*ServiceDescriptorProto) GetName ¶
func (sd *ServiceDescriptorProto) GetName() string
func (*ServiceDescriptorProto) SetServiceOptions ¶
func (sd *ServiceDescriptorProto) SetServiceOptions(options *descriptorpb.ServiceOptions) *ServiceDescriptorProto
type SourceInfoComputeFunc ¶
type SourceInfoComputeFunc func()
SourceInfoComputeFunc is the type that a desc.Descriptor will embed. It will be aliased in the desc package to an unexported name so it is not marked as an exported field in reflection and not present in Go docs.
type SourceInfoComputer ¶
type SourceInfoComputer interface {
// contains filtered or unexported methods
}
SourceInfoComputer is a single method which will be invoked to recompute source info. This is needed for the protoparse package, which needs to link descriptors without source info in order to interpret options, but then needs to re-compute source info after that interpretation so that final linked descriptors expose the right info.
type SourceInfoMap ¶
type SourceInfoMap map[string][]*descriptorpb.SourceCodeInfo_Location
SourceInfoMap is a map of paths in a descriptor to the corresponding source code info.
func CreateSourceInfoMap ¶
func CreateSourceInfoMap(fd *descriptorpb.FileDescriptorProto) SourceInfoMap
CreateSourceInfoMap constructs a new SourceInfoMap and populates it with the source code info in the given file descriptor proto.
func (SourceInfoMap) Add ¶
func (m SourceInfoMap) Add(path []int32, loc *descriptorpb.SourceCodeInfo_Location)
Add stores the given source code info for the given path.
func (SourceInfoMap) Get ¶
func (m SourceInfoMap) Get(path []int32) *descriptorpb.SourceCodeInfo_Location
Get returns the source code info for the given path. If there are multiple locations for the same path, the first one is returned.
func (SourceInfoMap) GetAll ¶
func (m SourceInfoMap) GetAll(path []int32) []*descriptorpb.SourceCodeInfo_Location
GetAll returns all source code info for the given path.
func (SourceInfoMap) PutIfAbsent ¶
func (m SourceInfoMap) PutIfAbsent(path []int32, loc *descriptorpb.SourceCodeInfo_Location) bool
PutIfAbsent stores the given source code info for the given path only if the given path does not exist in the map. This method returns true when the value is stored, false if the path already exists.