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 DBTXWithBegin ¶ added in v0.2.0
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 DBTXWithBegin
// 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 ¶
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
riverui
command
|
|
|
internal
|
|
|
apiendpoint
Package apiendpoint provides a lightweight API framework for use with River UI.
|
Package apiendpoint provides a lightweight API framework for use with River UI. |
|
apierror
Package apierror contains a variety of marshalable API errors that adhere to a unified error response convention.
|
Package apierror contains a variety of marshalable API errors that adhere to a unified error response convention. |
|
util/sliceutil
Package sliceutil contains helpers related to slices, usually ones that are generic-related, and are broadly useful, but which the Go core team, in its infinite wisdom, has decided are too much power for the unwashed mashes, and therefore omitted from the utilities in `slices`.
|
Package sliceutil contains helpers related to slices, usually ones that are generic-related, and are broadly useful, but which the Go core team, in its infinite wisdom, has decided are too much power for the unwashed mashes, and therefore omitted from the utilities in `slices`. |
|
validate
Package validate internalizes Go Playground's Validator framework, setting some common options that we use everywhere, providing some useful helpers, and exporting a simplified API.
|
Package validate internalizes Go Playground's Validator framework, setting some common options that we use everywhere, providing some useful helpers, and exporting a simplified API. |
Click to show internal directories.
Click to hide internal directories.