contextutils

package
v0.11.7 Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2019 License: Apache-2.0 Imports: 7 Imported by: 279

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CliLogErrorw

func CliLogErrorw(ctx context.Context, message string, keysAndValues ...interface{})

func CliLogInfow

func CliLogInfow(ctx context.Context, message string, keysAndValues ...interface{})

func CliLogWarnw

func CliLogWarnw(ctx context.Context, message string, keysAndValues ...interface{})

func GetLogLevel

func GetLogLevel() zapcore.Level

func LoggerFrom

func LoggerFrom(ctx context.Context) *zap.SugaredLogger

func SetFallbackLogger

func SetFallbackLogger(logger *zap.SugaredLogger)

func SetLogLevel

func SetLogLevel(l zapcore.Level)

func SilenceLogger

func SilenceLogger(ctx context.Context) context.Context

func Sleep

func Sleep(ctx context.Context, amount time.Duration) error

func WithErrorHandler

func WithErrorHandler(ctx context.Context, errorHandler ErrorHandler) context.Context

func WithLogger

func WithLogger(ctx context.Context, name string) context.Context

func WithLoggerValues

func WithLoggerValues(ctx context.Context, meta ...interface{}) context.Context

Types

type Backoff

type Backoff interface {
	Backoff(ctx context.Context, f func(ctx context.Context) error) error
}

func NewExponentioalBackoff

func NewExponentioalBackoff(eb ExponentioalBackoff) Backoff

type ErrorHandler

type ErrorHandler interface {
	HandleErr(error)
}

func ErrorHandlerFrom

func ErrorHandlerFrom(ctx context.Context) ErrorHandler

type ErrorLogger

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

func (*ErrorLogger) HandleErr

func (h *ErrorLogger) HandleErr(err error)

type ExponentioalBackoff

type ExponentioalBackoff struct {
	MaxRetries  uint
	MaxDuration *time.Duration
	MaxDelay    *time.Duration
}

Jump to

Keyboard shortcuts

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