loader

package
v0.3.0-20261120180237-... Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2026 License: Apache-2.0 Imports: 2 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package loader holds the "load one entity by id from a store" pattern shared by Stovepipe's queue controllers (build, process, buildsignal).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ByID

func ByID[T any](ctx context.Context, id string, get func(context.Context, string) (T, error), entityName string) (T, error)

ByID loads one entity by id via get, returning it unwrapped on success. On failure it wraps the error as "failed to load <entityName> <id>: <cause>" so every stovepipe controller reports load failures in the same shape.

get is typically a store's Get method value passed directly (e.g. c.store.GetRequestStore().Get), which fixes T through inference so callers never spell out the type parameter.

Not-found is never special-cased into a retryable error here: per the storage read-after-write-consistency contract (see stovepipe/extension/storage/README.md), a Get miss on a row that a causally-prior write should already have produced is a storage implementation defect, not a lag condition worth retrying through. It surfaces as a plain error, non-retryable by platform/errs's default.

Types

This section is empty.

Jump to

Keyboard shortcuts

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