util

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SonicUseInt64 = sonic.Config{
	UseInt64: true,
}.Froze()

Functions

func ConvertNameCase

func ConvertNameCase(opt meta.NameCase, name string) string

func SplitGoTags

func SplitGoTags(input string) []string

func SplitPrefix

func SplitPrefix(t string) (pkg, name string)

func SplitSubfix

func SplitSubfix(t string) (typ, val string)

func SplitSubfix2

func SplitSubfix2(t string) (typ, val string)

func SplitTagOptions

func SplitTagOptions(tag string) (ret []string, err error)

func ToLowerCamelCase

func ToLowerCamelCase(name string) string

LowerFirstLetter

func ToSnakeCase

func ToSnakeCase(name string) string

ToSnakeCase converts a camelCase string to snake_case.

func ToUpperCamelCase

func ToUpperCamelCase(name string) string

ToCamelCase converts a snake_case string to camelCase.

Types

type FieldIDMap added in v0.4.1

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

FieldIDMap is a map from field id to field descriptor

func (FieldIDMap) All added in v0.4.1

func (fd FieldIDMap) All() (ret []unsafe.Pointer)

All returns all field descriptors

func (FieldIDMap) Get added in v0.4.1

func (fd FieldIDMap) Get(id int32) unsafe.Pointer

Get gets the field descriptor for the given id

func (*FieldIDMap) Set added in v0.4.1

func (fd *FieldIDMap) Set(id int32, f unsafe.Pointer)

Set sets the field descriptor for the given id

func (FieldIDMap) Size added in v0.4.1

func (fd FieldIDMap) Size() int

Size returns the size of the map

type FieldNameMap added in v0.4.1

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

FieldNameMap is a map for field name and field descriptor

func (FieldNameMap) All added in v0.4.1

func (ft FieldNameMap) All() []caching.Pair

All returns all field descriptors

func (*FieldNameMap) Build added in v0.4.1

func (ft *FieldNameMap) Build()

Build builds the map. It will try to build a trie tree if the dispersion of keys is higher enough (min).

func (FieldNameMap) Get added in v0.4.1

func (ft FieldNameMap) Get(k string) unsafe.Pointer

Get gets the field descriptor for the given key

func (*FieldNameMap) Set added in v0.4.1

func (ft *FieldNameMap) Set(key string, field unsafe.Pointer) (exist bool)

Set sets the field descriptor for the given key

func (FieldNameMap) Size added in v0.4.1

func (ft FieldNameMap) Size() int

Size returns the size of the map

Jump to

Keyboard shortcuts

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