helpers

package
v1.3.3 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2020 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Check

func Check(url string, status int) (string, error)

func CheckProxy added in v1.1.4

func CheckProxy(url string, status int, header *proxyproto.Header) (string, error)

func Concat

func Concat(left error, right error) error

func Fanout added in v0.23.0

func Fanout(funcs []func() error) func() error

func PruneHome added in v0.25.0

func PruneHome(pwd string) string

func RandomString

func RandomString(n int) string

RandomString generates an alphabetic string with uppercase and lowercase letters of size n with some chance of being unique

func RandomStringRunes

func RandomStringRunes(n int, runes []rune) string

RandomString generates an alphabetic string with uppercase and lowercase letters of size n with some chance of being unique

func Retry

func Retry(timer *time.Timer, interval time.Duration, callback func() (retry bool)) error

func ToStringKeyedMap

func ToStringKeyedMap(m interface{}) (map[string]interface{}, error)

Types

type Synchronizer

type Synchronizer struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

Synchronizer implements the error interface as well as the Causer interface from package github.com/pkg/errors It just returns the first error when Cause is called

It is well suited for scatter and gather synchronization

func NewSynchronizer

func NewSynchronizer(wg *sync.WaitGroup) *Synchronizer

func (*Synchronizer) Cause

func (s *Synchronizer) Cause() error

func (*Synchronizer) Done

func (s *Synchronizer) Done(err error)

func (Synchronizer) Error

func (s Synchronizer) Error() string

func (*Synchronizer) IsError

func (s *Synchronizer) IsError() bool

Jump to

Keyboard shortcuts

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