util

package
v0.6.5 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2024 License: MIT Imports: 11 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

View Source
var V = validator.New(validator.WithRequiredStructEnabled())

Functions

func DirExist

func DirExist(path string) bool

func FileExist

func FileExist(path string) bool

func GetNicSpeed

func GetNicSpeed(nic string) (int, error)

GetNicSpeed get nic speed in Mbps.

func IsFunc added in v0.4.3

func IsFunc(v interface{}) bool

func IsPointer added in v0.2.6

func IsPointer(v interface{}) bool

func IsStruct added in v0.2.6

func IsStruct(v interface{}) bool

func IsStructPointer added in v0.2.6

func IsStructPointer(v interface{}) bool

func NetDevStats

func NetDevStats(nic ...string) (map[string]map[string]uint64, error)

NetDevStats get statistics about nic 根据网卡名获取网卡运行状态,用途之一是用来计算RX和TX速度,支持获取多个nic状态.

func PathExist

func PathExist(path string, isDir bool) bool

func RandInt

func RandInt(min, max int) int

func ReflectGetFuncName added in v0.4.3

func ReflectGetFuncName(v interface{}) string

func ReflectSet added in v0.0.3

func ReflectSet(i interface{}, f interface{}) bool

func Unique

func Unique[S ~[]E, E comparable](s S) S

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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