utils

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2023 License: MIT Imports: 9 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AvailableDiskSize

func AvailableDiskSize() (int64, error)

AvailableDiskSize returns available size of the disk of the machine where the DB hosts in

func CopyDir

func CopyDir(src, dst string, exclude []string) error

CopyDir copy the data files in a given source directory to a given destination directory

Files excluded will be ignored.

func DirSize

func DirSize(d string) (int64, error)

DirSize returns the total size (unit: B) of all files in a given directory.

func Float64FromBytes

func Float64FromBytes(buffer []byte) float64

Float64FromBytes parses a floating number from the given byte array

func Float64ToBytes

func Float64ToBytes(value float64) []byte

Float64ToBytes encodes the given floating number to a byte array

func NewKey

func NewKey(n int) []byte

NewKey generates a random key for testing

func NewRandomValue

func NewRandomValue(n int) []byte

NewRandomValue generates a random value for testing

Types

This section is empty.

Jump to

Keyboard shortcuts

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