Documentation ¶
Index ¶
- Variables
- func GoProtoName(s string) string
- type DuplicateTagNumberError
- type Field
- func (f *Field) CleanPluralName() string
- func (*Field) Descriptor() ([]byte, []int)deprecated
- func (x *Field) GetComment() string
- func (x *Field) GetDataType() SupportedType
- func (x *Field) GetIndent() string
- func (x *Field) GetName() string
- func (x *Field) GetPluralName() string
- func (x *Field) GetTagNum() int32
- func (f *Field) GoName() string
- func (f *Field) GoPluralName() string
- func (f *Field) GoType() string
- func (f *Field) PrettyComments() []string
- func (*Field) ProtoMessage()
- func (x *Field) ProtoReflect() protoreflect.Message
- func (x *Field) Reset()
- func (f *Field) RustNeedClone() string
- func (f *Field) RustType() string
- func (x *Field) String() string
- func (f *Field) WriteFieldDefinition(w io.Writer) error
- type GoProtoFile
- type Option
- type ProtoFile
- func (*ProtoFile) Descriptor() ([]byte, []int)deprecated
- func (x *ProtoFile) GetComment() string
- func (x *ProtoFile) GetFieldIndent() string
- func (x *ProtoFile) GetOptions() []*Option
- func (x *ProtoFile) GetPackageName() string
- func (x *ProtoFile) GetStructs() []*Struct
- func (f *ProtoFile) PrettyComments() []string
- func (f *ProtoFile) ProtoFileDefinition() (string, error)
- func (*ProtoFile) ProtoMessage()
- func (x *ProtoFile) ProtoReflect() protoreflect.Message
- func (x *ProtoFile) Reset()
- func (x *ProtoFile) String() string
- func (f *ProtoFile) UpdateFieldIndent()
- func (f *ProtoFile) ValidateTagNumbers() error
- func (f *ProtoFile) WriteProtoFileDefinition(w io.Writer) error
- type RustCopyConfig
- type RustProtoFile
- type Struct
- func (m *Struct) CleanPluralName() string
- func (*Struct) Descriptor() ([]byte, []int)deprecated
- func (m *Struct) FirstField() *Field
- func (x *Struct) GetComment() string
- func (x *Struct) GetFields() []*Field
- func (x *Struct) GetName() string
- func (x *Struct) GetPluralName() string
- func (s *Struct) MessageDefinition(w io.Writer) error
- func (s *Struct) PrettyComments() []string
- func (*Struct) ProtoMessage()
- func (x *Struct) ProtoReflect() protoreflect.Message
- func (x *Struct) Reset()
- func (x *Struct) String() string
- func (m *Struct) ValidTagNumbers() error
- type SupportedType
- func (SupportedType) Descriptor() protoreflect.EnumDescriptor
- func (x SupportedType) Enum() *SupportedType
- func (SupportedType) EnumDescriptor() ([]byte, []int)deprecated
- func (t SupportedType) GoType() (string, error)
- func (t SupportedType) MarshalYAML() ([]byte, error)
- func (t SupportedType) MustProtoTypeString() string
- func (x SupportedType) Number() protoreflect.EnumNumber
- func (t SupportedType) ProtoTypeString() (string, error)
- func (t SupportedType) RustType() (string, error)
- func (x SupportedType) String() string
- func (SupportedType) Type() protoreflect.EnumType
- func (t *SupportedType) UnmarshalJSON(b []byte) error
- func (t *SupportedType) UnmarshalYAML(b []byte) error
Constants ¶
This section is empty.
Variables ¶
var ( SupportedType_name = map[int32]string{ 0: "Unknown", 1: "Int64", 2: "Int32", 3: "Uint64", 4: "Uint32", 5: "Sint64", 6: "Sint32", 7: "Fixed64", 8: "Fixed32", 9: "Sfixed64", 10: "Sfixed32", 11: "Bool", 12: "String", 13: "Bytes", 14: "Float", 15: "Double", } SupportedType_value = map[string]int32{ "Unknown": 0, "Int64": 1, "Int32": 2, "Uint64": 3, "Uint32": 4, "Sint64": 5, "Sint32": 6, "Fixed64": 7, "Fixed32": 8, "Sfixed64": 9, "Sfixed32": 10, "Bool": 11, "String": 12, "Bytes": 13, "Float": 14, "Double": 15, } )
Enum value maps for SupportedType.
var File_config_proto protoreflect.FileDescriptor
Functions ¶
func GoProtoName ¶
GoProtoName is a copy of GoCamelCase from the protobuf-go library.
GoCamelCase camel-cases a protobuf name for use as a Go identifier.
If there is an interior underscore followed by a lower case letter, drop the underscore and convert the letter to upper case.
Types ¶
type DuplicateTagNumberError ¶
func IsDuplicateTagNumberError ¶
func IsDuplicateTagNumberError(err error) *DuplicateTagNumberError
func (DuplicateTagNumberError) Error ¶
func (d DuplicateTagNumberError) Error() string
type Field ¶
type Field struct { // name of the field, it will be used in the message for row. Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // name of the field when it's in the dataframe/column message. // If no plural_name is provided, name + "s" will be used. PluralName string `protobuf:"bytes,2,opt,name=plural_name,json=pluralName,proto3" json:"plural_name,omitempty"` // type of the data. DataType SupportedType `protobuf:"varint,11,opt,name=data_type,json=dataType,proto3,enum=protorowdf.SupportedType" json:"data_type,omitempty"` // tag num TagNum int32 `protobuf:"varint,12,opt,name=tag_num,json=tagNum,proto3" json:"tag_num,omitempty"` // comments will be copied over with the beginning spaces and // trailing spaces will be removed, otherwise it's verbatim copied over // including blank lines and indents. Comment string `protobuf:"bytes,21,opt,name=comment,proto3" json:"comment,omitempty"` // indent of the field, 2 spaces if set to empty. // this can also be set in the [ProtoFile] message. Indent string `protobuf:"bytes,42,opt,name=indent,proto3" json:"indent,omitempty"` // contains filtered or unexported fields }
Field represents a field of generated proto message defintion.
func (*Field) CleanPluralName ¶
func (*Field) Descriptor
deprecated
func (*Field) GetComment ¶
func (*Field) GetDataType ¶
func (x *Field) GetDataType() SupportedType
func (*Field) GetPluralName ¶
func (*Field) GoPluralName ¶
func (*Field) PrettyComments ¶
func (*Field) ProtoMessage ¶
func (*Field) ProtoMessage()
func (*Field) ProtoReflect ¶
func (x *Field) ProtoReflect() protoreflect.Message
func (*Field) RustNeedClone ¶
type GoProtoFile ¶
func (*GoProtoFile) CopyDataCode ¶
func (g *GoProtoFile) CopyDataCode() (string, error)
func (*GoProtoFile) GoPackageName ¶
func (g *GoProtoFile) GoPackageName() string
func (*GoProtoFile) WriteCopyDataCode ¶
func (g *GoProtoFile) WriteCopyDataCode(w io.Writer) error
type Option ¶
type Option struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` // contains filtered or unexported fields }
Option for this protofile
func (*Option) Descriptor
deprecated
func (*Option) ProtoMessage ¶
func (*Option) ProtoMessage()
func (*Option) ProtoReflect ¶
func (x *Option) ProtoReflect() protoreflect.Message
type ProtoFile ¶
type ProtoFile struct { // package name PackageName string `protobuf:"bytes,1,opt,name=package_name,json=packageName,proto3" json:"package_name,omitempty"` // messages contained in this file, note each Struct generate two message // types. Structs []*Struct `protobuf:"bytes,11,rep,name=structs,proto3" json:"structs,omitempty"` // Options Options []*Option `protobuf:"bytes,21,rep,name=options,proto3" json:"options,omitempty"` // comments will be copied over with the beginning spaces and // trailing spaces will be removed, otherwise it's verbatim copied over // including blank lines and indents. Comment string `protobuf:"bytes,31,opt,name=comment,proto3" json:"comment,omitempty"` // indent of fields for the fields contained in this file. FieldIndent string `protobuf:"bytes,42,opt,name=field_indent,json=fieldIndent,proto3" json:"field_indent,omitempty"` // contains filtered or unexported fields }
ProtoFile defines the structure of the protofile.
func (*ProtoFile) Descriptor
deprecated
func (*ProtoFile) GetComment ¶
func (*ProtoFile) GetFieldIndent ¶
func (*ProtoFile) GetOptions ¶
func (*ProtoFile) GetPackageName ¶
func (*ProtoFile) GetStructs ¶
func (*ProtoFile) PrettyComments ¶
func (*ProtoFile) ProtoFileDefinition ¶
func (*ProtoFile) ProtoMessage ¶
func (*ProtoFile) ProtoMessage()
func (*ProtoFile) ProtoReflect ¶
func (x *ProtoFile) ProtoReflect() protoreflect.Message
func (*ProtoFile) UpdateFieldIndent ¶
func (f *ProtoFile) UpdateFieldIndent()
func (*ProtoFile) ValidateTagNumbers ¶
type RustCopyConfig ¶
type RustProtoFile ¶
type RustProtoFile struct { *ProtoFile *RustCopyConfig }
func (*RustProtoFile) CopyDataCode ¶
func (r *RustProtoFile) CopyDataCode() (string, error)
func (*RustProtoFile) IncludeLine ¶
func (r *RustProtoFile) IncludeLine() string
func (*RustProtoFile) WriteCopyDataCode ¶
func (r *RustProtoFile) WriteCopyDataCode(w io.Writer) error
type Struct ¶
type Struct struct { // name of the generate row message type. Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // name of the dataframe message type. use name + "s" if unset. PluralName string `protobuf:"bytes,2,opt,name=plural_name,json=pluralName,proto3" json:"plural_name,omitempty"` // fields for the struct. Fields []*Field `protobuf:"bytes,11,rep,name=fields,proto3" json:"fields,omitempty"` // comments will be copied over with the beginning spaces and // trailing spaces will be removed, otherwise it's verbatim copied over // including blank lines and indents. Comment string `protobuf:"bytes,21,opt,name=comment,proto3" json:"comment,omitempty"` // contains filtered or unexported fields }
Struct represents the structure of the message.
func (*Struct) CleanPluralName ¶
func (*Struct) Descriptor
deprecated
func (*Struct) FirstField ¶
func (*Struct) GetComment ¶
func (*Struct) GetPluralName ¶
func (*Struct) PrettyComments ¶
func (*Struct) ProtoMessage ¶
func (*Struct) ProtoMessage()
func (*Struct) ProtoReflect ¶
func (x *Struct) ProtoReflect() protoreflect.Message
func (*Struct) ValidTagNumbers ¶
type SupportedType ¶
type SupportedType int32
SupportedType limits the types that we support. Those types are their proto types with first letter capitalized, except for Unknown.
const ( SupportedType_Unknown SupportedType = 0 SupportedType_Int64 SupportedType = 1 SupportedType_Int32 SupportedType = 2 SupportedType_Uint64 SupportedType = 3 SupportedType_Uint32 SupportedType = 4 SupportedType_Sint64 SupportedType = 5 SupportedType_Sint32 SupportedType = 6 SupportedType_Fixed64 SupportedType = 7 SupportedType_Fixed32 SupportedType = 8 SupportedType_Sfixed64 SupportedType = 9 SupportedType_Sfixed32 SupportedType = 10 SupportedType_Bool SupportedType = 11 SupportedType_String SupportedType = 12 SupportedType_Bytes SupportedType = 13 SupportedType_Float SupportedType = 14 SupportedType_Double SupportedType = 15 )
func (SupportedType) Descriptor ¶
func (SupportedType) Descriptor() protoreflect.EnumDescriptor
func (SupportedType) Enum ¶
func (x SupportedType) Enum() *SupportedType
func (SupportedType) EnumDescriptor
deprecated
func (SupportedType) EnumDescriptor() ([]byte, []int)
Deprecated: Use SupportedType.Descriptor instead.
func (SupportedType) GoType ¶
func (t SupportedType) GoType() (string, error)
func (SupportedType) MarshalYAML ¶
func (t SupportedType) MarshalYAML() ([]byte, error)
func (SupportedType) MustProtoTypeString ¶
func (t SupportedType) MustProtoTypeString() string
func (SupportedType) Number ¶
func (x SupportedType) Number() protoreflect.EnumNumber
func (SupportedType) ProtoTypeString ¶
func (t SupportedType) ProtoTypeString() (string, error)
ProtoTypeString returns the proto type as a string
func (SupportedType) RustType ¶
func (t SupportedType) RustType() (string, error)
func (SupportedType) String ¶
func (x SupportedType) String() string
func (SupportedType) Type ¶
func (SupportedType) Type() protoreflect.EnumType
func (*SupportedType) UnmarshalJSON ¶
func (t *SupportedType) UnmarshalJSON(b []byte) error
func (*SupportedType) UnmarshalYAML ¶
func (t *SupportedType) UnmarshalYAML(b []byte) error