helpers

package
v0.210504.0 Latest Latest
Warning

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

Go to latest
Published: May 4, 2021 License: CC0-1.0 Imports: 12 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AliveSub

func AliveSub(root, leaf *alive.Alive)

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 added in v0.201022.0

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 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 MockHTTP

type MockHTTP struct {
	Fun    func(*http.Request) (*http.Response, error)
	Header []byte
	Body   []byte
	Err    error
}

func (*MockHTTP) RoundTrip

func (m *MockHTTP) RoundTrip(req *http.Request) (*http.Response, error)

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