internal

package
v0.0.0-...-70a76fe Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Errorf = fmt.Errorf

Functions

func Str

func Str(key, value string) func(logrus.Fields)

Str adds a string field

func UseFmtErrorf

func UseFmtErrorf()

func UseXerrorsErrorf

func UseXerrorsErrorf()

func With

func With(ctx context.Context, opts ...func(logrus.Fields)) context.Context

With Adds fields

Types

type Dispatcher

type Dispatcher struct {
	JobQueue chan Job
	Quit     chan bool
	// contains filtered or unexported fields
}

func NewDispatcher

func NewDispatcher() Dispatcher

func (*Dispatcher) AddJob

func (d *Dispatcher) AddJob(job Job)

func (*Dispatcher) Start

func (d *Dispatcher) Start(ctx context.Context, numWorkers int)

func (*Dispatcher) Stop

func (d *Dispatcher) Stop(ctx context.Context)

type Job

type Job interface {
	Run(ctx context.Context) error
}

type Logger

type Logger interface {
	logrus.FieldLogger
	WriterLevel(logrus.Level) *io.PipeWriter
}

Logger the Traefik logger

func FromContext

func FromContext(ctx context.Context) Logger

FromContext Gets the logger from context

type Worker

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

func NewWorker

func NewWorker(id int, workerPool chan chan Job) Worker

func (*Worker) Start

func (w *Worker) Start(ctx context.Context)

func (*Worker) Stop

func (w *Worker) Stop(ctx context.Context)

Jump to

Keyboard shortcuts

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