types

package
v0.10.7 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

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

func BelongToFirstElement(name, prefix string) bool

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 IsEnum added in v0.9.15

func IsEnum(text string) bool

IsEnum checks if text matches the enum type patterns.

func IsKeyedList added in v0.9.15

func IsKeyedList(text string) bool

IsKeyedList checks if text matches the keyed list type patterns.

func IsList added in v0.9.15

func IsList(text string) bool

IsList checks if text matches the list type patterns.

func IsMap added in v0.9.15

func IsMap(text string) bool

IsMap checks if text matches the map type patterns.

func IsScalarType

func IsScalarType(t string) bool

func IsStruct added in v0.9.15

func IsStruct(text string) bool

IsStruct checks if text matches the struct type patterns.

func MatchBoringInteger

func MatchBoringInteger(text string) []string

Types

type Descriptor added in v0.10.7

type Descriptor struct {
	Name       string
	FullName   string
	Predefined bool
	Kind       Kind
}

Descriptor describes type metadata.

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 Kind

type Kind int
const (
	ScalarKind Kind = iota
	EnumKind
	ListKind
	MapKind
	MessageKind
)

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]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

Jump to

Keyboard shortcuts

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