{"modulePath":"github.com/uber/submitqueue","version":"v0.3.0-20261204225004-ef0e72fca7fb","isLatest":false,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package loader\n\nPackage loader holds the \"load one entity by id from a store\" pattern shared by Stovepipe's queue controllers (build, process, buildsignal).\n\n## Functions\n\n```go\nfunc ByID[T any](ctx context.Context, id string, get func(context.Context, string) (T, error), entityName string) (T, error)\n```\nByID loads one entity by id via get, returning it unwrapped on success. On failure it wraps the error as \"failed to load \\\u003centityName\u003e \\\u003cid\u003e: \\\u003ccause\u003e\" so every stovepipe controller reports load failures in the same shape.\n\nget 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.\n\nNot-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.\n\n","path":"github.com/uber/submitqueue/stovepipe/core/loader","name":"loader","synopsis":"Package loader holds the \"load one entity by id from a store\" pattern shared by Stovepipe's queue controllers (build, process, buildsignal).","isRedistributable":true}
