storage

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package storage defines the public object-storage boundary used by upload collections. Document stores never receive file bytes.

Index

Constants

View Source
const MaxListPageSize = 1_000

MaxListPageSize bounds one adapter listing response. Reconciliation streams pages so a large bucket never has to fit in memory.

Variables

View Source
var ErrNotFound = errors.New("object not found")

Functions

This section is empty.

Types

type Backend

Backend is the smallest contract required by upload delivery, cleanup, and orphan reconciliation. Implementations must treat Put of an existing key as an atomic replacement, Delete of a missing key as a successful no-op, and List pages as key-ordered, unique, restricted to the requested prefix, no larger than the requested limit, and carrying an authoritative non-zero ModifiedAt timestamp. NextCursor must advance and remain stable for the duration of one listing. Ridu still revalidates object ownership and committed upload references immediately before destructive reconciliation.

type HealthBackend

type HealthBackend interface {
	Ping(context.Context) error
}

HealthBackend is implemented by production backends that can verify their required dependency without reading or mutating an application object. Ridu includes it in /readyz when available; custom backends should keep the check bounded by Context and safe to call repeatedly.

type ListPage

type ListPage struct {
	Objects    []Object
	NextCursor string
}

ListPage contains one key-ordered page. NextCursor is empty only on the final page.

type ListRequest

type ListRequest struct {
	Prefix string
	Cursor string
	Limit  int
}

ListRequest selects one bounded, stable page of object metadata. Cursor is opaque to callers and must be returned unchanged from a prior ListPage.

type Object

type Object struct {
	Key         string
	Size        int64
	ContentType string
	// ModifiedAt must be non-zero for every object returned by List. Ridu uses
	// it to enforce the reconciliation grace period and refuses cleanup when it
	// is unavailable.
	ModifiedAt time.Time
}

type URLSigner

type URLSigner interface {
	SignedURL(context.Context, string, time.Duration) (string, error)
}

URLSigner is optional. Private delivery remains mediated by Ridu; this is for explicit short-lived direct-download flows.

Jump to

Keyboard shortcuts

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