common

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2020 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Useful routines used in several other packages.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddInt64

func AddInt64(a, b int64) (int64, error)

Safe sum for int64.

func AddUint64

func AddUint64(a, b uint64) (uint64, error)

Safe sum for uint64.

func Bts2Str added in v0.6.0

func Bts2Str(bts [][]byte) []string

func CleanTemporaryDirs

func CleanTemporaryDirs(dirs []string) error

func Dup

func Dup(b []byte) []byte

duplicate (copy) bytes

func FromBase58JSON

func FromBase58JSON(value []byte, size int, name string) ([]byte, error)

func FromBase58JSONUnsized

func FromBase58JSONUnsized(value []byte, name string) ([]byte, error)

func FromBase64JSON added in v0.6.0

func FromBase64JSON(value []byte, size int, name string) ([]byte, error)

func FromBase64JSONUnsized added in v0.6.0

func FromBase64JSONUnsized(value []byte, name string) ([]byte, error)

func GetStatePath

func GetStatePath() (string, error)

func MinOf

func MinOf(vars ...uint64) uint64

func ParseDuration

func ParseDuration(str string) (uint64, error)

func SetupLogger

func SetupLogger(level string) (*zap.Logger, *zap.SugaredLogger)

func TimeTrack

func TimeTrack(start time.Time, name string)

func ToBase58JSON

func ToBase58JSON(b []byte) []byte

func ToBase64JSON added in v0.6.0

func ToBase64JSON(b []byte) []byte

func TrackLongFunc

func TrackLongFunc(duration time.Duration, value ...string) func()

call function like this defer TrackLongFunc()()

Types

This section is empty.

Jump to

Keyboard shortcuts

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