Documentation
¶
Index ¶
- func ETag(artifactObj core.ArtifactObj) string
- func KindLabel(artifactObj core.ArtifactObj) string
- func LocateGlobalFormatKey(ctx context.Context, store StoreInterface, materializerID string, kind string, ...) (core.ArtifactObj, core.ArtifactKeyObj, bool, error)
- func LocateKey(ctx context.Context, store StoreInterface, materializerID string, kind string, ...) (core.ArtifactObj, core.ArtifactKeyObj, bool, error)
- func NameSuffix(artifactObj core.ArtifactObj) (name string, suffix string)
- type BodyObj
- type OpenObj
- type StoreInterface
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ETag ¶
func ETag(artifactObj core.ArtifactObj) string
ETag returns a stable artifact ETag from metadata or the quoted blake3-24 body hash.
func KindLabel ¶
func KindLabel(artifactObj core.ArtifactObj) string
KindLabel returns the schema/UI artifact kind label for a materializer and kind.
func LocateGlobalFormatKey ¶ added in v0.3.0
func LocateGlobalFormatKey(ctx context.Context, store StoreInterface, materializerID string, kind string, key string, version string, formatVersion uint32) (core.ArtifactObj, core.ArtifactKeyObj, bool, error)
LocateGlobalFormatKey finds a global-scope artifact only when its format version matches the current descriptor. It is used for host-independent universal archives so stale listener-specific or older-format rows cannot shadow current global metadata before background reconciliation has cleaned them up.
func LocateKey ¶
func LocateKey(ctx context.Context, store StoreInterface, materializerID string, kind string, key string, version string, listenerID stcode.ListenerType) (core.ArtifactObj, core.ArtifactKeyObj, bool, error)
LocateKey finds a registered artifact from listener-specific to global scope without materialization, returning both metadata and the matched key. Metadata first lets callers answer 304 before expensive builds; the returned key lets a follow-up open reuse the resolved scope instead of re-querying it (OpenResolved).
func NameSuffix ¶
func NameSuffix(artifactObj core.ArtifactObj) (name string, suffix string)
NameSuffix returns the artifact file name and key-relative suffix. The caller builds URLs with its link builder, so host context does not enter this package.
Types ¶
type BodyObj ¶
type BodyObj struct {
// contains filtered or unexported fields
}
BodyObj streams an artifact body directly from *os.File without RAM buffering. Close delegates to HotFileObj.Close, closing the fd and releasing the shared-file refcount. ogen calls Close after io.Copy through io.Closer, so the refcount is released.
type OpenObj ¶
OpenObj is the result of open: streaming body plus its modification time. ETag is decided by the caller from the located metadata, not carried here.
func OpenResolved ¶
func OpenResolved(ctx context.Context, store StoreInterface, keyObj core.ArtifactKeyObj, builderObj storage.ArtifactBuilderInterface, modTime time.Time) (OpenObj, error)
OpenResolved materializes the hot file for an artifact key already resolved by a locate helper, so a full GET does not re-query GetArtifact. Missing/failed materialization returns serr.ErrUnavailable; context cancellation is passed through. On success OpenObj.Body owns the file and the caller must close it.
type StoreInterface ¶
type StoreInterface interface {
GetArtifact(ctx context.Context, keyObj core.ArtifactKeyObj) (core.ArtifactObj, bool, error)
EnsureArtifactFile(ctx context.Context, keyObj core.ArtifactKeyObj, builderObj storage.ArtifactBuilderInterface) (*storage.HotFileObj, error)
}
StoreInterface is the narrow storage surface for artifact lookup and materialization. The caller builds the EnsureArtifactFile builder.