platform

package
v0.0.0-...-80cf7ea Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetComponentUniqueID

func GetComponentUniqueID(component string) (id string)

GetComponentUniqueID produces a non RFC 4122 UUID that is tied to the MAC address if available for is generated randomly if not

func GetMacAddrWithoutDelimiters

func GetMacAddrWithoutDelimiters() (macAddr string, err kv.Error)

func GetPseudoUUID

func GetPseudoUUID() (uuid string)

GetPseudoUUID will generate an RFC 4122 compliant UUID using Version 4

func ParseBytes

func ParseBytes(val string) (bytes uint64, err error)

parseBytes returns a value for the input string.

This function uses the humanize library from github for go.

Typical inputs can include by way of examples '6gb', '6 GB', '6 GiB'. Inputs support SI and IEC sizes. For more information please review https://github.com/dustin/go-humanize/blob/master/bytes.go

func Round

func Round(x float64) float64

Round returns the nearest integer, rounding half away from zero. This function is available natively in Go 1.10

Special cases are:

Round(±0) = ±0
Round(±Inf) = ±Inf
Round(NaN) = NaN

func StartOpenCensus

func StartOpenCensus(ctx context.Context, apiKey string, dataset string) (err kv.Error)

Types

type Exclusive

type Exclusive struct {
	Name     string
	ReleaseC chan struct{}
	// contains filtered or unexported fields
}

func NewExclusive

func NewExclusive(name string, quitC chan struct{}) (excl *Exclusive, err kv.Error)

type Logger

type Logger struct {
	// contains filtered or unexported fields
}

func NewLogger

func NewLogger(component string) (log *Logger)

func (*Logger) Debug

func (l *Logger) Debug(msg string, args ...interface{})

func (*Logger) Error

func (l *Logger) Error(msg string, args ...interface{}) error

func (*Logger) Fatal

func (l *Logger) Fatal(msg string, args ...interface{})

func (*Logger) Info

func (l *Logger) Info(msg string, args ...interface{})

func (*Logger) IsDebug

func (l *Logger) IsDebug() bool

func (*Logger) IsInfo

func (l *Logger) IsInfo() bool

func (*Logger) IsTrace

func (l *Logger) IsTrace() bool

func (*Logger) IsWarn

func (l *Logger) IsWarn() bool

func (*Logger) Log

func (l *Logger) Log(level int, msg string, args []interface{})

func (*Logger) SetLevel

func (l *Logger) SetLevel(lvl int)

func (*Logger) Trace

func (l *Logger) Trace(msg string, args ...interface{})

func (*Logger) Warn

func (l *Logger) Warn(msg string, args ...interface{}) error

Jump to

Keyboard shortcuts

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