Documentation
¶
Index ¶
- Variables
- func BinarySearch(a []string, v interface{}) int
- func BuildFormatString(format string, a ...any) string
- func BuildString(a ...any) string
- func BytesToInt[T int | int8 | int16 | int32 | int64 | uint | uint8 | uint16 | uint32 | uint64](bytesArr []byte, data *T) T
- func BytesToIntEndian[T int | int8 | int16 | int32 | int64 | uint | uint8 | uint16 | uint32 | uint64](bytesArr []byte, data *T, endian Endian) T
- func Collect[T any, V any](source []T, fn func(one T) V) []V
- func Copy[T any](src *T) *T
- func CopyArray[T any](src []any, dest []T) []T
- func ElmType(value reflect.Value) reflect.Type
- func GetBool(s string) (bool, error)
- func GetFloat(s string) (float64, error)
- func GetIPv4ByInterface(name string) ([]string, error)
- func GetInt(s string) (int64, error)
- func GetUint(s string) (uint64, error)
- func GroupBy[T any, K Keyable](source []T, fn func(one T) K) map[K][]T
- func GuessIP(remote string) *string
- func IP(ip string) string
- func InsertAt[T any](list []T, idx int, t T) []T
- func Int64ToStr(i int64) string
- func IntToBytes[T int | int8 | int16 | int32 | int64 | uint | uint8 | uint16 | uint32 | uint64](intNum T) []byte
- func IntToBytesEndian[T int | int8 | int16 | int32 | int64 | uint | uint8 | uint16 | uint32 | uint64](intNum T, endian Endian) []byte
- func IsEmpty(str string) bool
- func LeftPad(str string, limit int, placeholder rune) string
- func LocalIPv4s() ([]string, error)
- func MD5(data string) string
- func Map[T any, K Keyable](source []T, fn func(T) K) map[K]T
- func MapStream[T any, K Keyable](source map[K]T, fn func(K, T))
- func NewInstanceValue(t reflect.Type) reflect.Value
- func ParseParameterName(str string) []string
- func ParseURL(url string) (schema, host, query string, rtnErr error)
- func RandRune() rune
- func RandRune2(s, e rune) rune
- func Reduce[T any, R any](source []T, fn func(one T) (R, bool)) []R
- func RemoveAt[T any](list []T, idx int) []T
- func ReplaceAt[T any](list []T, idx int, t T) []T
- func ReplaceIP(address, ip string) string
- func ReplaceParameterValue(str string, keyAndValue map[string]string) string
- func ReplaceParameterWithKeyValue(str string, keyAndValue map[string]string) string
- func ReplacePort(address, port string) string
- func Reverse[T any](source []T) []T
- func RightPad(str string, limit int, placeholder rune) string
- func SaltMd5(data, salt string) string
- func SetUnExportFieldValue[T any](obj *T, field string, data any) (rtnErr error)
- func SplitHostPort(address string) (host, port string, err error)
- func Str2Bool(source string) (any, error)
- func Str2Float32(source string) (any, error)
- func Str2Float64(source string) (any, error)
- func Str2Int(source string) (any, error)
- func Str2Int16(source string) (any, error)
- func Str2Int32(source string) (any, error)
- func Str2Int64(source string) (any, error)
- func Str2Int8(source string) (any, error)
- func Str2Object(v string, k reflect.Kind) (any, error)
- func Str2UInt64(source string) (any, error)
- func Str2Uint(source string) (any, error)
- func Str2Uint16(source string) (any, error)
- func Str2Uint32(source string) (any, error)
- func Str2Uint8(source string) (any, error)
- func StrNumSuffixInt(str string, mult int) int
- func Stream[T any](source []T, fn func(one T))
- func String(obj any) string
- func Substring(source string, start int, end int) string
- func Type2Str(t reflect.Type) (string, error)
- func TypeOf(obj any) reflect.Type
- func Values[T any, K Keyable](source map[K]T) []T
- type Dimension
- type Endian
- type Keyable
- type Numeric
- type RegExpError
Constants ¶
This section is empty.
Variables ¶
View Source
var RegExpPool = make(regExpPool)
Functions ¶
func BinarySearch ¶
func BuildFormatString ¶
func BuildString ¶
func BytesToInt ¶ added in v1.0.20
func BytesToInt[T int | int8 | int16 | int32 | int64 | uint | uint8 | uint16 | uint32 | uint64](bytesArr []byte, data *T) T
BytesToInt 将以Big端存储的长为1/2字节的数转化成int类型的数
func BytesToIntEndian ¶ added in v1.0.20
func GetIPv4ByInterface ¶ added in v1.0.4
GetIPv4ByInterface return IPv4 address from a specific interface IPv4 addresses
func IntToBytes ¶ added in v1.0.20
func IntToBytes[T int | int8 | int16 | int32 | int64 | uint | uint8 | uint16 | uint32 | uint64](intNum T) []byte
IntToBytes 将int类型的数转化为字节并以Big端存储
func IntToBytesEndian ¶ added in v1.0.20
func IntToBytesEndian[T int | int8 | int16 | int32 | int64 | uint | uint8 | uint16 | uint32 | uint64](intNum T, endian Endian) []byte
IntToBytesEndian 将int类型的数转化为字节并以Big端存储
func LocalIPv4s ¶ added in v1.0.4
LocalIPv4s 获取本地内网ip LocalIPs return all non-loopback IPv4 addresses
func ParseParameterName ¶
func ReplaceParameterValue ¶
func ReplacePort ¶ added in v1.0.17
func SetUnExportFieldValue ¶ added in v1.0.21
func SplitHostPort ¶ added in v1.0.16
func Str2Float32 ¶
func Str2Float64 ¶
func Str2UInt64 ¶
func Str2Uint16 ¶
func Str2Uint32 ¶
func StrNumSuffixInt ¶
StrNumSuffixInt Parse a number with K/M/G suffixes based on thousands (1000) or 2^10 (1024)
Types ¶
type Dimension ¶ added in v1.0.24
type RegExpError ¶ added in v1.0.13
type RegExpError struct { }
func (RegExpError) Error ¶ added in v1.0.13
func (e RegExpError) Error() string
Source Files
¶
Click to show internal directories.
Click to hide internal directories.