util

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2022 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetPublicIPAddressOr

func GetPublicIPAddressOr(or string) string

TODO: use sync.Once

func NewMultipleError

func NewMultipleError(errs ...error) error

func WithSystemInterrupt

func WithSystemInterrupt(ctx context.Context) context.Context

Types

type ErrorGroup

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

func (*ErrorGroup) Add

func (eg *ErrorGroup) Add(delta int)

func (*ErrorGroup) Done

func (eg *ErrorGroup) Done(err error)

func (*ErrorGroup) Wait

func (eg *ErrorGroup) Wait() error

type Ticker

type Ticker struct {
	C chan struct{}
	// contains filtered or unexported fields
}

func NewPerHourTicker

func NewPerHourTicker(numTicksPerHour int, startOffset time.Duration) Ticker

func NewTicker

func NewTicker(period time.Duration, variation time.Duration) Ticker

func (Ticker) Stop

func (t Ticker) Stop()

type WorkerPool

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

func NewWorkerPool

func NewWorkerPool(numWorkers int) *WorkerPool

func (*WorkerPool) Run

func (pool *WorkerPool) Run(ctx context.Context, f func())

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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