util

package
v0.0.0-...-ecfc0d7 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RandBytes

func RandBytes(len int) ([]byte, error)

RandBytes returns a random []byte with length l

func RandDuration

func RandDuration(average time.Duration, delta float64) time.Duration

RandDuration generates a random duration

func ResetTimer

func ResetTimer(timer *time.Timer, duration time.Duration)

ResetTimer stops and resets a timer

func StopTimer

func StopTimer(timer *time.Timer)

StopTimer stops a timer and clear out the channel if not yet

Types

type Errors

type Errors []error

Errors is a list of errors

func NewErrors

func NewErrors() Errors

NewErrors creates a new Errors

func (Errors) Merged

func (errs Errors) Merged() error

Merged returns a single error containing the string representation of all errors in Errors, or nil if no err in errs

Jump to

Keyboard shortcuts

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