helpers

package
v0.240209.0 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2024 License: CC0-1.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AliveSub

func AliveSub(root, leaf *alive.Alive)

func ConfigDefaultInt added in v0.240106.0

func ConfigDefaultInt(InInt int, valueIfIntZero int) int

func ConfigDefaultStr added in v0.240106.0

func ConfigDefaultStr(inString string, valueIfStringBlank string) string

func FoldErrChan

func FoldErrChan(ch <-chan error) error

func FoldErrors

func FoldErrors(errs []error) error

func HexSpecialBytes

func HexSpecialBytes(input []byte) string

func HexSpecialString

func HexSpecialString(input string) string

func IntMillisecondDefault

func IntMillisecondDefault(x int, def time.Duration) time.Duration

func IntSecondConfigDefault

func IntSecondConfigDefault(x int, def int) time.Duration

func IntSecondDefault

func IntSecondDefault(x int, def time.Duration) time.Duration

func MustHex

func MustHex(s string) []byte

func RandUnix

func RandUnix() *rand.Rand

func SaveAndShowDoError added in v0.220623.0

func SaveAndShowDoError(li []string, err error)

func WithLock

func WithLock(l sync.Locker, f func())

func WithLockError

func WithLockError(l sync.Locker, f func() error) error

func WrapErrChan

func WrapErrChan(wg *sync.WaitGroup, ch chan<- error, fun func() error)

Types

type AtomicError

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

func (*AtomicError) Load

func (a *AtomicError) Load() (error, bool)

func (*AtomicError) StoreOnce

func (a *AtomicError) StoreOnce(e error) (error, bool)

StoreOnce stores e only first time, returns same as Load() before modification.

type FatalFunc

type FatalFunc func(...interface{})

type Fataler

type Fataler interface {
	Fatal(...interface{})
}

type LogDoItems added in v0.220623.0

type LogDoItems map[time.Time]string

Directories

Path Synopsis
Atomic value with validity timeout.
Atomic value with validity timeout.

Jump to

Keyboard shortcuts

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