xtypes

package
v0.2.9 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2024 License: Apache-2.0 Imports: 12 Imported by: 26

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Deprecated: As of Go v0.2.0, this function simply calls [xreflect.GetBool].
	GetBool = xreflect.GetBool
	// Deprecated: As of Go v0.2.0, this function simply calls [xreflect.GetString].
	GetString = xreflect.GetString
	// Deprecated: As of Go v0.2.0, this function simply calls [xreflect.GetInt].
	GetInt = xreflect.GetInt
	// Deprecated: As of Go v0.2.0, this function simply calls [xreflect.GetInt64].
	GetInt64 = xreflect.GetInt64
	// Deprecated: As of Go v0.2.0, this function simply calls [xreflect.GetUint64].
	GetUint64 = xreflect.GetUint64
	// Deprecated: As of Go v0.2.0, this function simply calls [xreflect.GetFloat64].
	GetFloat64 = xreflect.GetFloat64
)
View Source
var AvgDecimal = decimal.Avg
View Source
var DecimalZero = decimal.Zero
View Source
var MaxDecimal = decimal.Max
View Source
var MinDecimal = decimal.Min
View Source
var NewDecimal = decimal.New
View Source
var NewDecimalFromBigInt = decimal.NewFromBigInt
View Source
var NewDecimalFromFloat = decimal.NewFromFloat
View Source
var NewDecimalFromFloat32 = decimal.NewFromFloat32
View Source
var NewDecimalFromFloatWithExponent = decimal.NewFromFloatWithExponent
View Source
var NewDecimalFromInt = decimal.NewFromInt
View Source
var NewDecimalFromInt32 = decimal.NewFromInt32
View Source
var NewDecimalFromString = decimal.NewFromString
View Source
var SumDecimal = decimal.Sum

Functions

This section is empty.

Types

type Decimal added in v0.1.15

type Decimal = decimal.Decimal

type NullDecimal added in v0.1.20

type NullDecimal = decimal.NullDecimal

type Pair added in v0.2.8

type Pair[K comparable, V any] struct {
	Key   K
	Value V
}

Pair 表示一个键值对

type SMap

type SMap map[string]string

func (SMap) Del

func (m SMap) Del(key string)

func (SMap) Get

func (m SMap) Get(name string) string

func (SMap) GetWithDefault

func (m SMap) GetWithDefault(name string, def string) string

func (SMap) IsEmpty added in v0.2.5

func (m SMap) IsEmpty() bool

func (SMap) Keys

func (m SMap) Keys() []string

func (SMap) Len added in v0.2.5

func (m SMap) Len() int

func (*SMap) MapScan added in v0.1.28

func (m *SMap) MapScan(obj interface{}) error

func (SMap) MarshalBinary

func (m SMap) MarshalBinary() (data []byte, err error)

func (SMap) Read

func (m SMap) Read(p []byte) (n int, err error)

func (SMap) Scan deprecated

func (m SMap) Scan(obj interface{}) error

Deprecated: As of Go v0.2.0, this function simply calls [ScanTo].

func (SMap) ScanTo added in v0.1.35

func (m SMap) ScanTo(obj interface{}) error

func (SMap) Set

func (m SMap) Set(key, val string)

func (SMap) Translate

func (m SMap) Translate(tpl string) string

func (SMap) Value added in v0.1.34

func (m SMap) Value() (driver.Value, error)

Value String

func (SMap) Values

func (m SMap) Values() map[string]string

type SortCompare added in v0.2.8

type SortCompare[K comparable] func(a, b K) bool

type SortedMap added in v0.2.8

type SortedMap[K comparable, V any] struct {
	// contains filtered or unexported fields
}

SortedMap 是一个有序映射

func NewSortedMap added in v0.2.8

func NewSortedMap[K comparable, V any](less SortCompare[K]) *SortedMap[K, V]

NewSortedMap 创建一个新的有序映射

func (*SortedMap[K, V]) Clear added in v0.2.8

func (m *SortedMap[K, V]) Clear()

func (*SortedMap[K, V]) Contains added in v0.2.8

func (m *SortedMap[K, V]) Contains(key K) bool

Contains 检查映射中是否包含某个键

func (*SortedMap[K, V]) Each added in v0.2.8

func (m *SortedMap[K, V]) Each(f func(K, V))

Each 遍历映射中的所有键值对

func (*SortedMap[K, V]) Get added in v0.2.8

func (m *SortedMap[K, V]) Get(key K) (V, bool)

Get 获取键对应的值

func (*SortedMap[K, V]) Keys added in v0.2.8

func (m *SortedMap[K, V]) Keys() []K

Keys 返回映射中的所有键

func (*SortedMap[K, V]) Len added in v0.2.8

func (m *SortedMap[K, V]) Len() int

func (SortedMap[K, V]) MarshalBinary added in v0.2.8

func (m SortedMap[K, V]) MarshalBinary() ([]byte, error)

func (SortedMap[K, V]) MarshalJSON added in v0.2.8

func (m SortedMap[K, V]) MarshalJSON() ([]byte, error)

func (*SortedMap[K, V]) Put added in v0.2.8

func (m *SortedMap[K, V]) Put(key K, value V)

Put 向映射中添加或更新一个键值对

func (*SortedMap[K, V]) PutAll added in v0.2.8

func (m *SortedMap[K, V]) PutAll(mapval map[K]V)

func (*SortedMap[K, V]) Remove added in v0.2.8

func (m *SortedMap[K, V]) Remove(key K)

Remove 从映射中移除一个键值对

func (*SortedMap[K, V]) ToMap added in v0.2.8

func (m *SortedMap[K, V]) ToMap() map[K]V

func (*SortedMap[K, V]) Values added in v0.2.8

func (m *SortedMap[K, V]) Values() []V

Values 返回映射中的所有值

type XMap

type XMap map[string]interface{}

func (XMap) Get

func (m XMap) Get(name string) (interface{}, bool)

Get 获取指定元素的值

func (XMap) GetBool

func (m XMap) GetBool(name string) bool

Get 获取指定元素的Bool值

func (XMap) GetFloat64 added in v0.1.2

func (m XMap) GetFloat64(key string) (float64, error)

func (XMap) GetInt added in v0.1.2

func (m XMap) GetInt(key string) (int, error)

func (XMap) GetInt64 added in v0.1.2

func (m XMap) GetInt64(key string) (int64, error)

func (XMap) GetString

func (m XMap) GetString(name string) string

Get 获取指定元素的值

func (XMap) IsEmpty

func (m XMap) IsEmpty() bool

func (XMap) Keys

func (m XMap) Keys() []string

Keys 从对象中获取数据值,如果不是字符串则返回空

func (XMap) Len

func (m XMap) Len() int

func (*XMap) MapScan added in v0.1.28

func (m *XMap) MapScan(obj interface{}) error

func (XMap) MarshalBinary

func (m XMap) MarshalBinary() (data []byte, err error)

func (XMap) Merge

func (m XMap) Merge(r XMap)

Merge 合并

func (XMap) SMap

func (m XMap) SMap() SMap

func (XMap) Scan

func (m XMap) Scan(obj interface{}) error

Scan 以json 标签进行序列化 Deprecated: As of Go v0.2.0, this function simply calls [ScanTo].

func (XMap) ScanTo added in v0.1.35

func (m XMap) ScanTo(obj interface{}) error

func (XMap) Translate

func (m XMap) Translate(tpl string) string

func (XMap) Value added in v0.1.34

func (m XMap) Value() (driver.Value, error)

Value String

type XMaps

type XMaps []XMap

func (*XMaps) Append

func (ms *XMaps) Append(i ...XMap) XMaps

func (XMaps) Get

func (ms XMaps) Get(idx int) XMap

func (XMaps) IsEmpty

func (ms XMaps) IsEmpty() bool

func (XMaps) Len

func (ms XMaps) Len() int

func (*XMaps) MapScan added in v0.1.28

func (m *XMaps) MapScan(obj interface{}) error

func (XMaps) MarshalBinary added in v0.1.34

func (m XMaps) MarshalBinary() (data []byte, err error)

func (XMaps) Scan deprecated added in v0.1.19

func (ms XMaps) Scan(obj interface{}) error

Deprecated: As of Go v0.2.0, this function simply calls [ScanTo].

func (XMaps) ScanTo added in v0.1.35

func (ms XMaps) ScanTo(obj interface{}) error

func (XMaps) Value added in v0.1.34

func (m XMaps) Value() (driver.Value, error)

Value String

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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