utils

package
v0.0.0-...-f92ab88 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2022 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const RequestIdKey = correlationIdType("requestId")

Variables

This section is empty.

Functions

func Logger

func Logger(ctx context.Context) *zap.Logger

func Retry

func Retry(attempts int, sleep time.Duration, f func() error) error

Retry attempts func f, in attempts, backing exponentially off by the specified Duration after each attempt which failed until the max number of attempts have been tried, then return an error

func WithReqId

func WithReqId(ctx context.Context, reqId string) context.Context

Types

type ScheduleTaskRunner

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

func NewScheduleTaskRunner

func NewScheduleTaskRunner(initialDelay time.Duration, delay time.Duration, logger *jsonlog.Logger) ScheduleTaskRunner

func (*ScheduleTaskRunner) Close

func (tr *ScheduleTaskRunner) Close()

func (*ScheduleTaskRunner) Start

func (tr *ScheduleTaskRunner) Start(task func()) error

Jump to

Keyboard shortcuts

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