Documentation ¶
Index ¶
- func AppendToFile(binary []byte, path string) error
- func ByteToIpv6String(x [6]byte) string
- func CreateDir(path string, perm os.FileMode) error
- func CreateFile(path string) (*os.File, error)
- func Ipv4ToUint32(ipv4 string) uint32
- func IsDir(path string) bool
- func IsFile(path string) bool
- func PanicGuard(f func())
- func PathExists(path string) bool
- func PingAddress(address string, waitTime time.Duration) bool
- func ProGress(percent *float32)
- func RandomLineFromFile(filePath string) (string, error)
- func SaveToFile(binary []byte, path string) error
- func Uint32ToIpv4(ipv4 uint32) string
- type Queue
- type Stack
- type StringSlice
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AppendToFile ¶
AppendToFile if path file not exist, first create it and append write binary to file.
func ByteToIpv6String ¶
ByteToIpv6String convert ipv6 format byte byte to string.
func CreateFile ¶
CreateFile create a file if it not exist.
func Ipv4ToUint32 ¶
Ipv4ToUint32 convert ipv4 format string to uint32.
func PanicGuard ¶
func PanicGuard(f func())
func PingAddress ¶
PingAddress probe ip or address can be connected. NOTE: github.com/go-ping/ping must with root permitted, so use command.
func ProGress ¶
func ProGress(percent *float32)
ProGress block to show process run status, exit when percent == 1.
func RandomLineFromFile ¶
RandomLineFromFile returns a random line from a file.
func SaveToFile ¶
SaveToFile if path file not exist, first create it and write binary to file.
func Uint32ToIpv4 ¶
Uint32ToIpv4 convert ipv4 format uint32 to string.
Types ¶
type Queue ¶
type Queue interface { Push(v interface{}) bool Pop() interface{} Back() interface{} Front() interface{} Size() int Empty() bool }
Queue queue interface.
type Stack ¶
type Stack interface { Push(v interface{}) bool Top() interface{} Pop() interface{} Size() int Empty() bool }
Stack stack interface.