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 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 callback[T]) (t T)
- func Ift[T any](condition bool, first T, second T) (t T)
- func Ifx[T any](condition bool, first callback[T], second 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 Ternary[T any](condition bool, first T, second T) (t T)
- func TernaryFunc[T any](condition bool, first callback[T], second callback[T]) (t T)
- func ToString(from any) (to string)
- func ToStrings(from ...any) (to []string)
- type Args
- type CannotCompare
- type CannotCopy
- type Case
- type Field
- type Fields
- type Key
- type Kv
- type Object
- type Package
- type Size
- type UriScheme
- type Value
Constants ¶
View Source
const ( // CasePositionNone 无 CasePositionNone casePosition = iota // CasePositionHead 首 CasePositionHead // CasePositionTail 尾 CasePositionTail // CasePositionAll 全部 CasePositionAll )
View Source
const ( // StringEmpty 空字符串 StringEmpty = "" StringSpace = " " // Float64Size 64位长度 Float64Size = 64 )
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 TernaryFunc ¶ added in v0.2.5
TernaryFunc 模拟三元表达式,主要用法是减少大括号
Types ¶
type Case ¶ added in v0.1.3
type Case string
Case 字符串转换
func (*Case) Underscore ¶ added in v0.1.3
Underscore 转为下划线写法
type Size ¶
type Size int64
Size 字节大小
func (*Size) MarshalJSON ¶ added in v0.0.7
func (*Size) UnmarshalJSON ¶ added in v0.0.7
type UriScheme ¶ added in v0.1.3
type UriScheme string
UriScheme 协议
const ( // UriSchemeUnknown 未知协议 UriSchemeUnknown UriScheme = `` // UriSchemeSocksV4 Socks协议 UriSchemeSocksV4 UriScheme = "socks4" // UriSchemeSocksV5 Socks协议 UriSchemeSocksV5 UriScheme = "socks4" // UriSchemeHttp Http协议 UriSchemeHttp UriScheme = "http" // UriSchemeHttps Https协议 UriSchemeHttps UriScheme = "https" // UriSchemeRtmp Rtmp协议 UriSchemeRtmp UriScheme = "rtmp" // UriSchemeMqtt MQTT协议 UriSchemeMqtt UriScheme = "mqtt" // UriSchemeMqtts MQTT安全协议 UriSchemeMqtts UriScheme = "mqtts" // UriSchemeWs Websocket协议 UriSchemeWs UriScheme = "ws" // UriSchemeWss Websocket安全协议 UriSchemeWss UriScheme = "wss" )
Source Files
¶
Click to show internal directories.
Click to hide internal directories.