Documentation ¶
Index ¶
- Variables
- func Bytes2String(bs []byte) string
- func Contains[S ~[]E, E comparable](s S, v E) bool
- func DirExist(path string) bool
- func FileExist(path string) bool
- func Float64ToUint64(val float64) uint64
- func GetNicSpeed(nic string) (int, error)
- func Index[S ~[]E, E comparable](s S, v E) int
- func Int64ToUint64(val int64) uint64
- func IsPointer(v interface{}) bool
- func IsStruct(v interface{}) bool
- func IsStructPointer(v interface{}) bool
- func NetDevStats(nic ...string) (map[string]map[string]uint64, error)
- func PathExist(path string, isDir bool) bool
- func RandInt(min int, max int) int
- func ReflectSet(i interface{}, f interface{}) bool
- func String2Bytes(s string) []byte
- func String2BytesNoCap(s string) []byte
- func Uint64ToFloat64(val uint64) float64
- func Uint64ToInt64(val uint64) int64
- func Unique[S ~[]E, E comparable](s S) S
Constants ¶
This section is empty.
Variables ¶
View Source
var V = validator.New(validator.WithRequiredStructEnabled())
Functions ¶
func Bytes2String ¶
func Contains ¶ added in v0.3.0
func Contains[S ~[]E, E comparable](s S, v E) bool
func Float64ToUint64 ¶
func Index ¶ added in v0.3.0
func Index[S ~[]E, E comparable](s S, v E) int
func Int64ToUint64 ¶
func IsStructPointer ¶ added in v0.2.6
func IsStructPointer(v interface{}) bool
func NetDevStats ¶
NetDevStats get statistics about nic 根据网卡名获取网卡运行状态,用途之一是用来计算RX和TX速度,支持获取多个nic状态.
func ReflectSet ¶ added in v0.0.3
func ReflectSet(i interface{}, f interface{}) bool
func String2Bytes ¶
func String2BytesNoCap ¶
func Uint64ToFloat64 ¶
func Uint64ToInt64 ¶
func Unique ¶
func Unique[S ~[]E, E comparable](s S) S
Types ¶
This section is empty.
Source Files ¶
Click to show internal directories.
Click to hide internal directories.