Documentation ¶
Index ¶
- Constants
- func BelongToFirstElement(name, prefix string) bool
- func CheckMessageWithOnlyKVFields(md protoreflect.MessageDescriptor) bool
- func IsEnum(text string) bool
- func IsKeyedList(text string) bool
- func IsList(text string) bool
- func IsMap(text string) bool
- func IsScalarType(t string) bool
- func IsStruct(text string) bool
- func IsWellKnownMessage(fullTypeName string) bool
- func MatchBoringInteger(text string) []string
- type Descriptor
- type EnumDescriptor
- type KeyedListDescriptor
- type Kind
- type ListDescriptor
- type MapDescriptor
- type PropDescriptor
- type ScalarDescriptor
- type StructDescriptor
Constants ¶
View Source
const ( WellKnownMessageTimestamp = "google.protobuf.Timestamp" WellKnownMessageDuration = "google.protobuf.Duration" )
View Source
const DefaultDocumentMapKeyOptName = "@key"
View Source
const DefaultDocumentMapValueOptName = "@value"
View Source
const DefaultListFieldOptNameSuffix = "List"
View Source
const DefaultMapFieldOptNameSuffix = "Map"
View Source
const DefaultMapKeyOptName = "Key"
View Source
const DefaultMapValueOptName = "Value"
View Source
const TypeGroup = `(` + nestedTypeCharClass + `*?)`
ungreedy type group
Variables ¶
This section is empty.
Functions ¶
func BelongToFirstElement ¶ added in v0.9.15
BelongToFirstElement returns true if the name has specified `prefix+"1"` and the next character is not digit.
func CheckMessageWithOnlyKVFields ¶ added in v0.10.7
func CheckMessageWithOnlyKVFields(md protoreflect.MessageDescriptor) bool
func IsKeyedList ¶ added in v0.9.15
IsKeyedList checks if text matches the keyed list type patterns.
func IsScalarType ¶
func IsWellKnownMessage ¶ added in v0.11.0
func MatchBoringInteger ¶
Types ¶
type Descriptor ¶ added in v0.10.7
Descriptor describes type metadata.
func ParseTypeDescriptor ¶ added in v0.11.0
func ParseTypeDescriptor(rawType string) *Descriptor
type EnumDescriptor ¶ added in v0.10.7
type EnumDescriptor struct { EnumType string Prop PropDescriptor }
func MatchEnum ¶
func MatchEnum(text string) *EnumDescriptor
MatchEnum matches the enum type pattern. For example:
- enum<Type>
- enum<.PredefinedType>
type KeyedListDescriptor ¶ added in v0.10.7
type KeyedListDescriptor struct { ElemType string ColumnType string Prop PropDescriptor }
func MatchKeyedList ¶
func MatchKeyedList(text string) *KeyedListDescriptor
MatchKeyedList matches the keyed list type patterns. For example:
- [ElemType]<Type>
- [.PredefinedElemType]<Type>
type ListDescriptor ¶ added in v0.10.7
type ListDescriptor struct { ElemType string ColumnType string Prop PropDescriptor }
func MatchList ¶
func MatchList(text string) *ListDescriptor
MatchList matches the list type patterns. For example:
- [ElemType]
- [ElemType]Type
- [.PredefinedElemType]Type
type MapDescriptor ¶ added in v0.10.7
type MapDescriptor struct { KeyType string ValueType string Prop PropDescriptor }
func MatchMap ¶
func MatchMap(text string) *MapDescriptor
MatchMap matches the map type patterns. For example:
- map<KeyType, ValueType>
- map<KeyType, .PredefinedValueType>
- map<.PredefinedKeyType, ValueType>
- map<.PredefinedKeyType, .PredefinedValueType>
type PropDescriptor ¶ added in v0.10.7
type PropDescriptor struct {
Text string // serialized prototext of tableaupb.FieldProp
}
func MatchProp ¶ added in v0.9.1
func MatchProp(text string) *PropDescriptor
func (*PropDescriptor) FieldProp ¶ added in v0.10.7
func (x *PropDescriptor) FieldProp() (*tableaupb.FieldProp, error)
func (*PropDescriptor) RawProp ¶ added in v0.10.7
func (x *PropDescriptor) RawProp() string
type ScalarDescriptor ¶ added in v0.10.7
type ScalarDescriptor struct { ScalarType string Prop PropDescriptor }
func MatchScalar ¶ added in v0.10.7
func MatchScalar(text string) *ScalarDescriptor
MatchScalar matches the scalar type pattern. For example:
- int32
- string
type StructDescriptor ¶ added in v0.10.7
type StructDescriptor struct { StructType string CustomName string ColumnType string Prop PropDescriptor }
func MatchStruct ¶
func MatchStruct(text string) *StructDescriptor
MatchStruct matches the struct type patterns. For example:
- {StructType}Type
- {StructType(CustomName)}Type
- {.PredefinedStructType}Type
- {.PredefinedStructType(CustomName)}Type
Click to show internal directories.
Click to hide internal directories.