utils

package
v0.0.0-...-4d07d55 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2019 License: GPL-3.0 Imports: 16 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildMerkleTree

func BuildMerkleTree(data [][]byte, hashFn hasher) error

func CheckFileExist

func CheckFileExist(link string) ([]string, error)

func Compress

func Compress(src []byte) ([]byte, error)

func DecodeBase32

func DecodeBase32(data string) ([]byte, error)

func Decompress

func Decompress(src []byte) ([]byte, error)

func EncodeBase32

func EncodeBase32(data []byte) string

func GetCPUInfo

func GetCPUInfo() error

func GetMemInfo

func GetMemInfo() error

func GetOSInfo

func GetOSInfo() error

func Hash256

func Hash256(data []byte) [32]byte

func Hash512

func Hash512(data []byte) [64]byte

func IndexOfString

func IndexOfString(element string, data []string) int

func IntArrayToStr

func IntArrayToStr(ns []int) string

func IsNumber

func IsNumber(str string) bool

func IsValidEmail

func IsValidEmail(str string) bool

func IsValidNameString

func IsValidNameString(str string) bool

func Must

func Must(err error)

func RandomUUIDGenBytes

func RandomUUIDGenBytes() []byte

func RandomUUIDGenString

func RandomUUIDGenString() string

func ReadFileFromSource

func ReadFileFromSource(source string) ([]byte, error)

func ReadFileZip

func ReadFileZip(rc io.Reader) ([]byte, error)

func ScanFolder

func ScanFolder(link string) ([]string, error)

func Unzip

func Unzip(src string, dest string) ([]string, error)

func WriteFiletoDisk

func WriteFiletoDisk(filename string, fileDir string, fileData []byte, fmode os.FileMode) error

Types

type SysInfo

type SysInfo struct {
	// stats *stats.Stats
	sync.Mutex
}

type VirtualSpace

type VirtualSpace struct {
	Capacity int
	Used     int
}

func GetDiskSpace

func GetDiskSpace() (VirtualSpace, error)

Jump to

Keyboard shortcuts

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