river

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2026 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Overview

Package river provides a set of tools for working with riverqueue

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Start

func Start(ctx context.Context, c Config) error

Start the river server with the given configuration

Types

type Config

type Config struct {
	// Logger configuration, which is inherited from the core logger
	Logger Logger `koanf:"-" json:"-"`

	// DatabaseHost for connecting to the postgres database
	DatabaseHost string `` /* 130-byte string literal not displayed */
	// Queues to be enabled on the server, if not provided, a default queue is created
	Queues []Queue `koanf:"queues" json:"queues" default:""`
	// Workers to be enabled on the server
	Workers Workers `koanf:"workers" json:"workers"`
	// TrustCenterWorkers holds additional worker configurations based on build tags
	TrustCenterWorkers trustcenter.Workers `koanf:"trustcenterworkers" json:"trustcenterworkers"`
	// DefaultMaxRetries is the maximum number of retries for failed jobs, this can be set differently per job
	DefaultMaxRetries int `koanf:"defaultmaxretries" json:"defaultmaxretries" default:"10"`

	// Metrics enables or disables metrics collection
	Metrics riverqueue.MetricsConfig `koanf:"metrics" json:"metrics"`
}

Config is the configuration for the river server

type Logger

type Logger struct {
	// Debug enables debug logging
	Debug bool `koanf:"-" json:"-"`
	// Pretty enables pretty logging
	Pretty bool `koanf:"-" json:"-"`
}

Logger is the configuration for the logger used in the river server

type Queue

type Queue struct {
	// Name of the queue
	Name string `koanf:"name" json:"name" default:"default"`
	// MaxWorkers allotted for the queue
	MaxWorkers int `koanf:"maxworkers" json:"maxworkers" default:"100"`
}

Queue is the configuration for a queue

type Workers

type Workers struct {
	// OpenlaneConfig configuration for openlane jobs, this is shared across multiple workers
	// if a worker needs specific configuration, it can be set in the worker's config
	OpenlaneConfig jobs.OpenlaneConfig `koanf:"openlaneconfig" json:"openlaneconfig"`

	// EmailConfig configuration for email templates shared across multiple workers
	EmailConfig jobs.EmailTemplateConfig `koanf:"emailconfig" json:"emailconfig"`

	// EmailWorker configuration for sending emails
	EmailWorker jobs.EmailWorker `koanf:"emailworker" json:"emailworker"`

	// ExportContentWorker configuration for exporting content
	ExportContentWorker jobs.ExportContentWorker `koanf:"exportcontentworker" json:"exportcontentworker"`

	// DeleteExportContentWorker configuration for batch deleting exports and clogging object storage
	DeleteExportContentWorker jobs.DeleteExportContentWorker `koanf:"deleteexportcontentworker" json:"deleteexportcontentworker"`

	// SlackWorker configuration for sending Slack messages
	SlackWorker jobs.SlackWorker `koanf:"slackworker" json:"slackworker"`
}

Workers that will be enabled on the server

Jump to

Keyboard shortcuts

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