utils

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2023 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var GlobalTransport = &http.Transport{
	DisableKeepAlives: true,
}

Functions

func CopyFile

func CopyFile(dst, src string) error

func DirFiles

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

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

func DirSize

func DirSize(path string) (uint64, error)

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

func Dirs

func Dirs(path string) ([]string, error)

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

func FildIpv4 added in v0.6.3

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

func GetDirFreeSpace

func GetDirFreeSpace(dir string) (uint64, error)

func GetISOWeek

func GetISOWeek() string

func GetSysMemAvailable

func GetSysMemAvailable() (uint64, error)

func GetSysMemTotle

func GetSysMemTotle() (uint64, error)

func InterfaceIsNIL added in v0.7.0

func InterfaceIsNIL(i interface{}) bool

InterfaceIsNIL returns the comparison between i and nil

func IsIntranetIpv4 added in v0.6.3

func IsIntranetIpv4(ipv4 string) (bool, error)

func OpenedPort

func OpenedPort(port int) bool

func QueryPeers added in v0.6.3

func QueryPeers(url string) ([]byte, error)

func RandSlice

func RandSlice(slice interface{})

func RandomInRange

func RandomInRange(min, max int) int

Get a random integer in a specified range

func RecoverError

func RecoverError(err interface{}) string

func RemoveRepeatedAddr added in v0.6.3

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

func Ternary

func Ternary(a, b int64) int64

Types

type MountPathInfo

type MountPathInfo struct {
	Path  string
	Total uint64
	Free  uint64
}

Jump to

Keyboard shortcuts

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