util

package
v0.0.0-...-9493ce7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 6, 2022 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ArrayToMap

func ArrayToMap(arr []string, sep string) map[string][]string

ArrayToMap

func Combinations2

func Combinations2(arr []int, callback func(tuple *tuple.Tuple))

Combinations2 组合

func Combinations3

func Combinations3(arr []int, callback func(triple *triple.Triple))

Combinations3 组合

func Copy

func Copy(dst, src interface{}) (err error)

Copy 复制

func EnsureDirExists

func EnsureDirExists(dirname string, mode os.FileMode) (err error)

EnsureDirExists 确保目录存在

func Hash

func Hash(hash crypto.Hash, in []byte) (out []byte)

Hash

func MD5

func MD5(in []byte) (out []byte)

MD5

func MD5String

func MD5String(in []byte) (out string)

MD5String

func MyIPAddresses

func MyIPAddresses() (ips []string)

MyIPAddresses 获取本机IP地址

func MyMACs

func MyMACs() (macs []string)

MyMACs 获取本机MAC地址

func PanicOnError

func PanicOnError(err error)

PanicOnError 错误时崩溃

func ReaderHash

func ReaderHash(hash crypto.Hash, reader io.Reader) (out []byte, err error)

ReaderHash

func ReaderMD5

func ReaderMD5(reader io.Reader) (out []byte, err error)

ReaderMD5

func ReaderSHA256

func ReaderSHA256(reader io.Reader) (out []byte, err error)

ReaderSHA256

func SHA256

func SHA256(in []byte) (out []byte)

SHA256

func Struct2Map

func Struct2Map(st interface{}, tagStr string) map[string]interface{}

Struct2Map 结构体转换为Map

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL