butils

package
v0.0.0-...-535e59b Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	B  = 1
	KB = 1 << 10
	MB = 1 << 20
	GB = 1 << 30
	TB = 1 << 40
	EB = 1 << 50
)

Variables

View Source
var (
	Hostname, _ = os.Hostname()

	HostIPs, InterfaceIPs []string
)

Functions

func Command

func Command(key string, arg ...string) string

func DirCreate

func DirCreate(path string) error

func DirSize

func DirSize(path string) (float64, error)

func FmtDuration

func FmtDuration(d time.Duration) string

func FmtSize

func FmtSize(size uint64) string

func GetDirSize

func GetDirSize(dir string) int64

func GetLocalIp

func GetLocalIp() string

func GetPortByHostPort

func GetPortByHostPort(hostport string) string

func IsFileExist

func IsFileExist(name string) bool

func IsFileNotExist

func IsFileNotExist(name string) bool

func IsPathExists

func IsPathExists(path string) (bool, error)

func LookupIPTimeout

func LookupIPTimeout(host string, timeout time.Duration) []net.IP

func ReplaceUnspecifiedIP

func ReplaceUnspecifiedIP(network string, listenAddr, globalAddr string) (string, error)

func ResolveTCPAddrTimeout

func ResolveTCPAddrTimeout(addr string, timeout time.Duration) *net.TCPAddr

Types

This section is empty.

Jump to

Keyboard shortcuts

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