Documentation
¶
Index ¶
- Constants
- func Atoi(num string, base int) int64
- func Atoid(num string) int64
- 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(num int64, base int) string
- func FormatIntd(num int64) string
- func Gid() (id uint64)
- func If[T any](condition bool, result T) (t T)
- func Iff[T any](condition bool, result internal.Callback[T]) (t T)
- func Ift[T any](condition bool, first T, second T) (t T)
- func Ifx[T any](condition bool, first internal.Callback[T], second internal.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 StringBuilder(items ...any) *text.Builder
- func Ternary[T any](condition bool, first T, second T) (t T)
- func TernaryFunc[T any](condition bool, first internal.Callback[T], second internal.Callback[T]) (t T)
- func ToString(from any) string
- func ToStrings(from ...any) []string
- type Bytes
- type CannotCompare
- type CannotCopy
- type Case
- type Column
- type Empty
- type Feature
- type Features
- type Field
- type Fields
- type Key
- type Kv
- type Labels
- type Microsecond
- type Millisecond
- type Nanosecond
- type Object
- type Package
- type Second
- type Value
Constants ¶
View Source
const ( BytesB = size.BytesB BytesKB = 1024 * BytesB BytesMB = 1024 * BytesKB BytesGB = 1024 * BytesMB BytesTB = 1024 * BytesGB BytesPB = 1024 * BytesTB BytesEB = 1024 * BytesPB )
View Source
const ( // CasePositionNone 无 CasePositionNone casePosition = iota // CasePositionHead 首 CasePositionHead // CasePositionTail 尾 CasePositionTail // CasePositionAll 全部 CasePositionAll )
Variables ¶
This section is empty.
Functions ¶
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 Case ¶ added in v0.1.3
type Case string
Case 字符串转换
func (*Case) Underscore ¶ added in v0.1.3
Underscore 转为下划线写法
type Features ¶ added in v0.5.4
type Features struct {
// contains filtered or unexported fields
}
Features 一个通用的开关
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
Source Files
¶
- bytes.go
- cannot_compare.go
- cannot_copy.go
- case.go
- case_position.go
- column.go
- coroutine.go
- empty.go
- feature.go
- features.go
- field.go
- fields.go
- flat.go
- if.go
- itoa.go
- key.go
- kv.go
- labels.go
- microsecond.go
- millisecond.go
- nanosecond.go
- object.go
- package.go
- second.go
- set.go
- slice.go
- statck.go
- string.go
- string_builder.go
- value.go
Click to show internal directories.
Click to hide internal directories.