Documentation
¶
Index ¶
- func ApplicationValues(values store.Values) store.Values
- func IsBusy(err error) bool
- func IsStorageError(err error) bool
- func ValidateNamespace(namespace string) error
- type BusyError
- type ImageInput
- type Input
- type Manager
- func (manager Manager) AcquireFile(ctx context.Context, bytes int64) (func(), error)
- func (manager Manager) Duplicate(ctx context.Context, collection schema.Collection, source store.Values) (Prepared, error)
- func (manager Manager) OwnsKey(key string) bool
- func (manager Manager) Prepare(ctx context.Context, collection schema.Collection, input Input) (Prepared, error)
- func (manager Manager) RegenerateImage(ctx context.Context, collection schema.Collection, input ImageInput) (Prepared, error)
- func (manager Manager) Rollback(ctx context.Context, prepared Prepared) error
- type Prepared
- type StorageError
- type WorkAdmission
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplicationValues ¶
ApplicationValues returns only application-owned upload document values. Storage metadata is always replaced by the manager after byte processing.
func IsStorageError ¶
func ValidateNamespace ¶
ValidateNamespace rejects ambiguous or path-shaped storage ownership names.
Types ¶
type BusyError ¶
type BusyError struct{ Resource string }
BusyError means the bounded admission queue is full. Callers should retry after backoff instead of treating it as invalid content.
type ImageInput ¶
type ImageInput struct {
ObjectKey string
FocalX float64
FocalY float64
CropX float64
CropY float64
CropWidth float64
CropHeight float64
}
ImageInput identifies an existing original image and the focal point used when regenerating configured cover variants.
type Manager ¶
type Manager struct {
Backend storage.Backend
Locker store.UploadObjectLocker
Namespace string
Admission *WorkAdmission
}
func (Manager) AcquireFile ¶
AcquireFile reserves compressed-byte capacity for a caller, such as remote download handling, that must allocate before Prepare receives its reader.
func (Manager) Duplicate ¶
func (manager Manager) Duplicate(ctx context.Context, collection schema.Collection, source store.Values) (Prepared, error)
Duplicate copies every stored object owned by an upload document into a fresh object-key namespace. The returned values replace only storage-owned metadata; callers remain responsible for duplicating the document itself.
func (Manager) OwnsKey ¶
OwnsKey reports whether one object belongs to this exact application namespace. Collection ownership comes from the access-checked document reference rather than a mutable collection slug in the key.
func (Manager) RegenerateImage ¶
func (manager Manager) RegenerateImage(ctx context.Context, collection schema.Collection, input ImageInput) (Prepared, error)
RegenerateImage creates a fresh set of configured variants from an existing original. The caller owns committing Values to the document and rolling back Keys if that commit fails.
type Prepared ¶
type StorageError ¶
type StorageError struct{ Cause error }
func (*StorageError) Error ¶
func (failure *StorageError) Error() string
func (*StorageError) Unwrap ¶
func (failure *StorageError) Unwrap() error
type WorkAdmission ¶
type WorkAdmission struct {
// contains filtered or unexported fields
}
WorkAdmission bounds compressed upload bytes and decoded image work across every application hosted by one Ridu process.
func NewWorkAdmission ¶
func NewWorkAdmission(fileBudgetBytes, imageBudgetBytes int64, queued int) *WorkAdmission
NewWorkAdmission constructs an isolated admission controller. It is public within the internal package so resource-bound behavior can be proven without consuming the process-wide production budget in tests.
func (*WorkAdmission) AcquireFile ¶
func (admission *WorkAdmission) AcquireFile(ctx context.Context, bytes int64) (func(), error)
func (*WorkAdmission) AcquireImage ¶
func (admission *WorkAdmission) AcquireImage(ctx context.Context, bytes int64) (func(), error)