internal

package
v0.0.0-...-c05fae0 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AsynqLogLevel

func AsynqLogLevel(level slog.Level) asynq.LogLevel

AsynqLogLevel converts level into an equivalent asynq.LogLevel.

func MergePeriodicTaskConfigProviders

func MergePeriodicTaskConfigProviders(providers ...asynq.PeriodicTaskConfigProvider) asynq.PeriodicTaskConfigProvider

MergePeriodicTaskConfigProviders creates a new periodic task config provider backed by the specified list of providers.

func TextUnmarshalerDecodeHook

func TextUnmarshalerDecodeHook(from reflect.Value, to reflect.Value) (any, error)

TextUnmarshalerDecodeHook is a decoding hook for the mapstructure package. The decoding hook implements support for the encoding.TextUnmarshaler interface.

Types

type AsynqLogger

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

AsynqLogger is an implementation of asynq.Logger backed by a slog.Logger. This logger implements the Fatal method by cancelling a context.

func NewAsynqLogger

func NewAsynqLogger(l *slog.Logger, log string) *AsynqLogger

NewAsynqLogger creates a new asynq.Logger instance backed by l. l will always add the "log" attribute with the specified value.

func (*AsynqLogger) Context

func (l *AsynqLogger) Context() context.Context

Context returns the context of l. If l.Fatal has been called, the context will be cancelled.

func (*AsynqLogger) Debug

func (l *AsynqLogger) Debug(args ...any)

Debug logs a message at Debug level.

func (*AsynqLogger) Error

func (l *AsynqLogger) Error(args ...any)

Error logs a message at Error level.

func (*AsynqLogger) Fatal

func (l *AsynqLogger) Fatal(args ...any)

Fatal logs a message at Error level. Additionally Fatal cancels the context of l, leading to the program's termination.

func (*AsynqLogger) Info

func (l *AsynqLogger) Info(args ...any)

Info logs a message at Info level.

func (*AsynqLogger) Warn

func (l *AsynqLogger) Warn(args ...any)

Warn logs a message at Warning level.

Jump to

Keyboard shortcuts

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