worker

package
v2.1.2 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Platform = "Worker"
)

Variables

This section is empty.

Functions

func Serve

func Serve(configs Configs, workers []Worker, builders []Builder)

Types

type Builder

type Builder func(context.Context) context.Context

func DIBuilder

func DIBuilder[T any](key string, provide func() T) Builder

type Configs

type Configs struct {
	WorkerPort netext.Port `env:"WORKER_PORT" envDefault:"7337"`
}

type Handler

type Handler struct {
}

func (Handler) ServeHTTP

func (Handler) ServeHTTP(res http.ResponseWriter, req *http.Request)

type Worker

type Worker interface {
	RegisterWorker(ctx context.Context)
}

Jump to

Keyboard shortcuts

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