Categorygithub.com/volts-dev/utils
modulepackage
0.0.0-20241206111447-ee54d4e2c42c
Repository: https://github.com/volts-dev/utils.git
Documentation: pkg.go.dev

# Packages

Package snowflake provides a very simple Twitter snowflake generator and parser.
Package mapstructure exposes functionality to convert one arbitrary Go type into another, typically to convert a map[string]interface{} into a native Go structure.

# Functions

No description provided by the author
execPath returns the executable path.
execPath returns the executable path.
No description provided by the author
Base64ToBytes converts from a b64 string to bytes.
Bytes converts string to byte slice.
BytesToBase64 converts bytes to a base64 string representation.
No description provided by the author
BytesToHex converts bytes to a hex string representation of bytes.
No description provided by the author
No description provided by the author
filter: jpg|go|png.
No description provided by the author
get current file dir name.
TEST return current file path including file name.
could not call _cur_path directly to get path.
No description provided by the author
convert like this: "HelloWorld" to "hello.world".
Equal is a helper for comparing value equality, following these rules: - Values with equivalent types are compared with reflect.DeepEqual - int, uint, and float values are compared without regard to the type width.
Fields returns a slice of *Field.
获得文件信息,如果文件存在不出错且不是文件夹 废弃.
No description provided by the author
generateRandomKey creates a random key with the given strength.
No description provided by the author
获取[]Map的指定Field.
No description provided by the author
HasZero returns true if any field is equal to a zero value.
HexToBytes converts a hex string representation of bytes to a byte representation.
check if in other slice return the index of the list otherwise -1 no match found.
No description provided by the author
int,int64 to bytes.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
TODO 添加类型 检查值是否为默认空值.
No description provided by the author
只解析'true','false'.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
IsStruct returns true if the given variable is a struct or a pointer to struct.
IsZero returns true if all fields is equal to a zero value.
transfer a map or struct to interface map.
No description provided by the author
No description provided by the author
No description provided by the author
TODO.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Name returns the structs's type name within its package.
Names returns a slice of field names.
No description provided by the author
Create a new queue.
func NewStringListParser(domain ...string) *TStringList { return NewDomain(domain...) } // [""] func NewDomain(domain ...string) *TStringList { if len(domain) == 0 || (len(domain) == 1 && domain[0] == "") { return NewStringList() // 创建空白 } lLexer := &TLexer{ stream: domain[0], length: len(domain[0]), pos: 0, isEof: false, } lParse := &TStringParser{ lexer: lLexer, strings: NewStringList(), } err := lParse.parse() if err != nil { return nil } return lParse.strings.Item(0) } */ 创建一个StringList.
New returns a new *Struct with the struct s.
# return a struct mame.
No description provided by the author
No description provided by the author
No description provided by the author
RandomCreateBytes generate random []byte by specify chars.
Repeat returns a new string consisting of count copies of the string s.
复制一个反转版.
No description provided by the author
SliceByteToString converts []byte to string without copy.
delete B values from A.
No description provided by the author
No description provided by the author
No description provided by the author
convert like this: "HelloWorld" to "hello_world".
String converts byte slice to string.
No description provided by the author
delete string from []string.
取交集.
StringToSliceByte converts string to []byte without copy.
No description provided by the author
Map converts the given struct to a map[string]interface{}.
convert string from "hello_world" to "HelloWorld".
convert string from "hello_world" to "HelloWorld".
No description provided by the author
No description provided by the author
ToFloat32E casts an interface to a float32 type.
ToFloat64E casts an interface to a float64 type.
No description provided by the author
No description provided by the author
ToInt64E casts an interface to an int64 type.
ToIntE casts an interface to an int type.
No description provided by the author
ToString casts an interface to a string type.
TODO 优化indirectToStringerOrError ToStringE casts an interface to a string type.
No description provided by the author
No description provided by the author
ToTimeE casts an interface to a time.Time type.
No description provided by the author
"HelloWorld" to "hello_world" to "HW".
No description provided by the author
Ints returns a unique subset of the int slice provided.
Unquote interprets s as a single-quoted, double-quoted, or backquoted Go string literal, returning the string value that s quotes.
Values converts the given struct to a []interface{}.

# Variables

struct's field default tag name.

# Structs

Field represents a single struct field that encapsulates high level functions around the field.
No description provided by the author
Field represents a single struct field that encapsulates high level functions around the field.
"reflect" "strings".
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Interfaces

No description provided by the author