riverui

package module
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2024 License: MPL-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewHandler

func NewHandler(opts *HandlerOpts) (http.Handler, error)

NewHandler creates a new http.Handler that serves the River UI and API.

Types

type HandlerOpts

type HandlerOpts struct {
	// Client is the River client to use for API requests.
	Client *river.Client[pgx.Tx]
	// DBPool is the database connection pool to use for API requests.
	DBPool *pgxpool.Pool
	// Logger is the logger to use logging errors within the handler.
	Logger *slog.Logger
	// Prefix is the path prefix to use for the API and UI HTTP requests.
	Prefix string
}

HandlerOpts are the options for creating a new Handler.

type RiverJob

type RiverJob struct {
	ID          int64                    `json:"id"`
	Args        json.RawMessage          `json:"args"`
	Attempt     int                      `json:"attempt"`
	AttemptedAt *time.Time               `json:"attempted_at"`
	AttemptedBy []string                 `json:"attempted_by"`
	CreatedAt   time.Time                `json:"created_at"`
	Errors      []rivertype.AttemptError `json:"errors"`
	FinalizedAt *time.Time               `json:"finalized_at"`
	Kind        string                   `json:"kind"`
	MaxAttempts int                      `json:"max_attempts"`
	Metadata    json.RawMessage          `json:"metadata"`
	Priority    int                      `json:"priority"`
	Queue       string                   `json:"queue"`
	ScheduledAt time.Time                `json:"scheduled_at"`
	State       string                   `json:"state"`
	Tags        []string                 `json:"tags"`
}

type RiverQueue

type RiverQueue struct {
	CountAvailable int64           `json:"count_available"`
	CountRunning   int64           `json:"count_running"`
	CreatedAt      time.Time       `json:"created_at"`
	Metadata       json.RawMessage `json:"metadata"`
	Name           string          `json:"name"`
	PausedAt       *time.Time      `json:"paused_at"`
	UpdatedAt      time.Time       `json:"updated_at"`
}

type StatesAndCountsResponse

type StatesAndCountsResponse struct {
	Available int64 `json:"available"`
	Cancelled int64 `json:"cancelled"`
	Completed int64 `json:"completed"`
	Discarded int64 `json:"discarded"`
	Pending   int64 `json:"pending"`
	Retryable int64 `json:"retryable"`
	Running   int64 `json:"running"`
	Scheduled int64 `json:"scheduled"`
}

type WorkflowGetResponse

type WorkflowGetResponse struct {
	Tasks []RiverJob `json:"tasks"`
}

Directories

Path Synopsis
cmd
riverui command
internal
db

Jump to

Keyboard shortcuts

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