testenv

package
v0.1.17 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BackendNull       = "null"
	BackendSync       = "sync"
	BackendWorkerpool = "workerpool"
	BackendSQLite     = "sqlite"
	BackendRedis      = "redis"
	BackendMySQL      = "mysql"
	BackendPostgres   = "postgres"
	BackendNATS       = "nats"
	BackendSQS        = "sqs"
	BackendRabbitMQ   = "rabbitmq"
)

Variables

Functions

func BackendEnabled

func BackendEnabled(envValue, name string) bool

func MySQLDSN

func MySQLDSN(addr string) string

func NewQueue

func NewQueue(cfg any, opts ...queue.Option) (*queue.Queue, error)

func Pause added in v0.1.12

func Pause(ctx context.Context, v any, queueName string) error

func PostgresDSN

func PostgresDSN(addr string) string

func Ready added in v0.1.12

func Ready(ctx context.Context, v any) error

func Resume added in v0.1.12

func Resume(ctx context.Context, v any, queueName string) error

func SelectedBackends

func SelectedBackends(envValue string) map[string]bool

SelectedBackends returns the enabled backend set for INTEGRATION_BACKEND. When unset or "all", all known backends are enabled.

func Snapshot added in v0.1.12

func Snapshot(ctx context.Context, v any, collector *queue.StatsCollector) (queue.StatsSnapshot, error)

func SupportsNativeStats added in v0.1.12

func SupportsNativeStats(v any) bool

func SupportsPause added in v0.1.12

func SupportsPause(v any) bool

Types

type Runtime

type Runtime interface {
	Driver() queue.Driver
	WithContext(ctx context.Context) Runtime
	Dispatch(job any) error
	Register(jobType string, handler queue.Handler)
	StartWorkers(ctx context.Context) error
	Shutdown(ctx context.Context) error
}

func NewQueueRuntime

func NewQueueRuntime(cfg any) (Runtime, error)

func WithWorkers

func WithWorkers(r Runtime, count int) Runtime

Jump to

Keyboard shortcuts

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