common

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2022 License: Apache-2.0 Imports: 10 Imported by: 11

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertUnmarshalledInt added in v0.3.0

func ConvertUnmarshalledInt(x interface{}) (int64, error)

func DirectoryExists

func DirectoryExists(directoryPath string) bool

DirectoryExists checks if the directory at the specified path exists

func GetTerminationSignalCh

func GetTerminationSignalCh() <-chan os.Signal

GetTerminationSignalCh returns a channel to emit signals by ctrl + c

func Max

func Max(a, b uint64) uint64

Max returns the strictly bigger number

func Min

func Min(a, b uint64) uint64

Min returns the strictly lower number

func SetupDataDir

func SetupDataDir(dataDir string, paths []string) error

SetupDataDir sets up the data directory and the corresponding sub-directories

func ToFixedFloat

func ToFixedFloat(num float64, precision int) float64

Types

type JSONNumber added in v0.3.0

type JSONNumber struct {
	Value uint64
}

JSONNumber is the number represented in decimal or hex in json

func (*JSONNumber) MarshalJSON added in v0.3.0

func (d *JSONNumber) MarshalJSON() ([]byte, error)

func (*JSONNumber) UnmarshalJSON added in v0.3.0

func (d *JSONNumber) UnmarshalJSON(data []byte) error

Jump to

Keyboard shortcuts

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