Documentation
¶
Overview ¶
Package artifact provides content-addressed Artifact storage adapters.
Index ¶
- Variables
- type Filesystem
- func (f *Filesystem) GarbageCollect(ctx context.Context, retention time.Duration, now time.Time) (int, error)
- func (f *Filesystem) Open(ctx context.Context, tenantID string, reference store.ArtifactReference) (io.ReadCloser, error)
- func (f *Filesystem) Put(ctx context.Context, tenantID, mediaType string, source io.Reader) (store.ArtifactReference, error)
Constants ¶
This section is empty.
Variables ¶
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)