Documentation ¶
Index ¶
- Constants
- func Atoi[T constraint.Int | constraint.Uint](num string, base int) T
- func Contains[T any](items *[]T, item T) bool
- func Diff[T any](first *[]T, second *[]T) (diff []T)
- func Flat[T flatType](from T) *flatConverter[T]
- func FormatInt[T constraint.Int](num T, base uint8, callback callback.FormatInt[T]) string
- func FormatUint[T constraint.Uint](num T, base uint8, callback callback.FormatUint[T]) string
- func Gid() (id uint64)
- func If[T any](condition bool, result T) (t T)
- func Iff[T any](condition bool, result callback.Callback[T]) (t T)
- func Ift[T any](condition bool, first T, second T) (t T)
- func Ifx[T any](condition bool, first callback.Callback[T], second callback.Callback[T]) (t T)
- func Index[T any](items *[]T, item T) (index int)
- func Set[T any](setter func(value T), first T, second T)
- func Stack(stack int, skip int) string
- func String(from string) *text.String
- func StringBuilder(items ...any) *text.Builder
- func Ternary[T any](condition bool, first T, second T) (t T)
- func TernaryFunc[T any](condition bool, first callback.Callback[T], second callback.Callback[T]) (t T)
- func ToString(from any) string
- func ToStrings(from ...any) []string
- type Bitmap
- func (b *Bitmap) All(position uint, positions ...uint) (contains bool)
- func (b *Bitmap) Any(position uint, positions ...uint) (contains bool)
- func (b *Bitmap) Contains(position uint) bool
- func (b *Bitmap) FromBytes(bytes []byte) (err error)
- func (b *Bitmap) FromHex(value string) (err error)
- func (b *Bitmap) MarshalJSON() ([]byte, error)
- func (b *Bitmap) Set(position uint, positions ...uint) *Bitmap
- func (b *Bitmap) UnmarshalJSON(data []byte) (err error)
- func (b *Bitmap) Unset(position uint, positions ...uint) *Bitmap
- type Bytes
- type Callback
- type Column
- type Empty
- type Feature
- type Features
- func (f *Features) All(feature Feature, features ...Feature) (enabled bool)
- func (f *Features) Any(feature Feature, features ...Feature) (enabled bool)
- func (f *Features) Disable(feature Feature, features ...Feature) *Features
- func (f *Features) Enable(feature Feature, features ...Feature) *Features
- func (f *Features) MarshalJSON() ([]byte, error)
- func (f *Features) UnmarshalJSON(data []byte) error
- type Field
- type Fields
- type Incomparable
- type Key
- type Kv
- type Labels
- type Microsecond
- type Millisecond
- type Nanosecond
- type Object
- type Package
- type Pointer
- type Pointerized
- type Reset
- type Second
- type Slice
- type Value
Constants ¶
Variables ¶
This section is empty.
Functions ¶
func Atoi ¶
func Atoi[T constraint.Int | constraint.Uint](num string, base int) T
Atoi 增强版进制转换,支持任意进制,最大76进制
func FormatUint ¶ added in v0.6.3
func FormatUint[T constraint.Uint](num T, base uint8, callback callback.FormatUint[T]) string
func Set ¶ added in v0.1.3
func Set[T any](setter func(value T), first T, second T)
Set 设置方法,当`first`值为零值时,设置为`second`的值,否则设置`first`的值
func StringBuilder ¶ added in v0.2.6
StringBuilder 创建字符串构建器
Types ¶
type Bitmap ¶ added in v0.5.7
type Bitmap struct {
// contains filtered or unexported fields
}
Bitmap 位图,通过使用位运算来设置位的开关
func (*Bitmap) MarshalJSON ¶ added in v0.5.8
func (*Bitmap) UnmarshalJSON ¶ added in v0.5.8
type Features ¶ added in v0.5.4
type Features struct {
// contains filtered or unexported fields
}
Features 一个通用的开关
func (*Features) MarshalJSON ¶ added in v0.5.9
func (*Features) UnmarshalJSON ¶ added in v0.5.9
type Incomparable ¶ added in v0.6.1
type Incomparable [0]func()
Incomparable 不可比较 包含本结构的结构体不能用于排序和比较大小
type Microsecond ¶ added in v0.3.9
Microsecond 微秒
func NewMicrosecond ¶ added in v0.4.0
func NewMicrosecond(from time.Time) *Microsecond
NewMicrosecond 从时间创建微秒
func ParseMicrosecond ¶ added in v0.3.9
func ParseMicrosecond(from string) (microsecond *Microsecond, err error)
ParseMicrosecond 从字符串解析微秒
func (Microsecond) MarshalJSON ¶ added in v0.3.9
func (m Microsecond) MarshalJSON() ([]byte, error)
func (*Microsecond) UnmarshalJSON ¶ added in v0.3.9
func (m *Microsecond) UnmarshalJSON(bytes []byte) (err error)
type Millisecond ¶ added in v0.3.9
Millisecond 毫秒
func NewMillisecond ¶ added in v0.4.0
func NewMillisecond(from time.Time) *Millisecond
NewMillisecond 从时间创建毫秒
func ParseMillisecond ¶ added in v0.3.9
func ParseMillisecond(from string) (millisecond *Millisecond, err error)
ParseMillisecond 从字符串解析毫秒
func (Millisecond) MarshalJSON ¶ added in v0.3.9
func (m Millisecond) MarshalJSON() ([]byte, error)
func (*Millisecond) UnmarshalJSON ¶ added in v0.3.9
func (m *Millisecond) UnmarshalJSON(bytes []byte) (err error)
type Nanosecond ¶ added in v0.3.9
Nanosecond 纳秒
func NewNanosecond ¶ added in v0.4.0
func NewNanosecond(from time.Time) *Nanosecond
NewNanosecond 从时间创建毫秒
func ParseNanosecond ¶ added in v0.3.9
func ParseNanosecond(from string) (nanosecond *Nanosecond, err error)
ParseNanosecond 从字符串解析毫秒
func (Nanosecond) MarshalJSON ¶ added in v0.3.9
func (n Nanosecond) MarshalJSON() ([]byte, error)
func (*Nanosecond) UnmarshalJSON ¶ added in v0.3.9
func (n *Nanosecond) UnmarshalJSON(bytes []byte) (err error)
type Second ¶ added in v0.3.9
Second 秒
func ParseSecond ¶ added in v0.3.9
ParseSecond 从字符串解析秒
func (Second) MarshalJSON ¶ added in v0.3.9
func (*Second) UnmarshalJSON ¶ added in v0.3.9
type Slice ¶ added in v0.6.4
type Slice[T any] []T
Slice 切片,既可以兼容单个值也可以兼容数组
func (*Slice[T]) UnmarshalJSON ¶ added in v0.6.4
func (*Slice[T]) UnmarshalXML ¶ added in v0.6.4
Source Files ¶
- array.go
- bitmap.go
- bytes.go
- callback.go
- column.go
- coroutine.go
- empty.go
- feature.go
- features.go
- field.go
- fields.go
- flat.go
- if.go
- incomparable.go
- itoa.go
- key.go
- kv.go
- labels.go
- microsecond.go
- millisecond.go
- nanosecond.go
- object.go
- package.go
- pointer.go
- pointerized.go
- reset.go
- second.go
- set.go
- slice.go
- stack.go
- string.go
- string_builder.go
- to_string.go
- value.go
Click to show internal directories.
Click to hide internal directories.