artifact

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package artifact provides content-addressed Artifact storage adapters.

Index

Constants

This section is empty.

Variables

View Source
var ErrQuotaExceeded = errors.New("artifact store quota exceeded")

ErrQuotaExceeded reports an artifact write that would breach the store's aggregate or per-tenant quota.

Functions

This section is empty.

Types

type Filesystem

type Filesystem struct {
	// contains filtered or unexported fields
}

func NewFilesystem

func NewFilesystem(root string, maxBytes int64) (*Filesystem, error)

func NewFilesystemWithQuotas

func NewFilesystemWithQuotas(root string, maxBytes, tenantQuota, totalQuota int64) (*Filesystem, error)

NewFilesystemWithQuotas constructs the store with aggregate bounds: the per-tenant quota and the total quota in bytes (0 = unlimited). Enforcement is best-effort O(files) for the dev adapter; production adapters index usage.

func (*Filesystem) GarbageCollect

func (f *Filesystem) GarbageCollect(ctx context.Context, retention time.Duration, now time.Time) (int, error)

GarbageCollect deletes artifacts whose modification time is older than the retention window (O7). The dev adapter is TTL-based: reference-aware GC (only unreferenced artifacts) is a projection documented with the audit retention trade-off. It returns the number of deleted files.

func (*Filesystem) Open

func (f *Filesystem) Open(ctx context.Context, tenantID string, reference store.ArtifactReference) (io.ReadCloser, error)

func (*Filesystem) Put

func (f *Filesystem) Put(ctx context.Context, tenantID, mediaType string, source io.Reader) (store.ArtifactReference, error)

Jump to

Keyboard shortcuts

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