utils

package
v0.3.6 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2024 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BytesToInt64

func BytesToInt64(buf []byte) int64

func CopyFile

func CopyFile(dst, src string) error

func DirDirs added in v0.3.2

func DirDirs(path string, count uint32) ([]string, error)

Get the total size of all files in a directory and subdirectories

func DirFiles

func DirFiles(path string, count uint32) ([]string, error)

Get the total size of all files in a directory and subdirectories

func FildIpv4 added in v0.2.5

func FildIpv4(data []byte) (string, bool)

func FindFile added in v0.2.3

func FindFile(dir, name string) string

func GetDirFreeSpace

func GetDirFreeSpace(dir string) (uint64, error)

func GetFileType

func GetFileType(fSrc string) (string, error)

func GetSysMemAvailable

func GetSysMemAvailable() (uint64, error)

func Int64ToBytes

func Int64ToBytes(i int64) []byte

func InterfaceIsNIL

func InterfaceIsNIL(i interface{}) bool

InterfaceIsNIL returns the comparison between i and nil

func IsIntranetIpv4 added in v0.2.5

func IsIntranetIpv4(ipv4 string) (bool, error)

func PasswdWithMask

func PasswdWithMask(hint string, defaultVal string, mask string) (string, error)

func RandSlice added in v0.3.4

func RandSlice(slice interface{})

func RecoverError

func RecoverError(err interface{}) string

RecoverError is used to record the stack information of panic

func RemoveRepeatedAddr added in v0.2.5

func RemoveRepeatedAddr(arr []multiaddr.Multiaddr) (newArr []multiaddr.Multiaddr)

func RenameDir

func RenameDir(oldDir, newDir string) error

func Ternary

func Ternary(a, b int64) int64

Types

This section is empty.

Jump to

Keyboard shortcuts

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