Versions in this module Expand all Collapse all v0 v0.1.0 Nov 10, 2026 Changes in this version + var ErrCapacity = errors.New("media_capacity_unavailable") + var ErrConflict = errors.New("media_conflict") + var ErrDenied = errors.New("media_permission_denied") + var ErrExpired = errors.New("media_upload_expired") + var ErrInput = errors.New("media_invalid_input") + var ErrIntegrity = errors.New("media_integrity_failed") + var ErrNotFound = errors.New("media_not_found") + var ErrType = errors.New("media_content_type_rejected") + var ErrUnavailable = errors.New("media_unavailable") + type Access struct + FileID string + Owner Principal + Protection Protection + Purpose string + Reference *Reference + VersionID string + type ArchiveEntry struct + Filename string + Path string + ReferenceID string + SHA256 string + Size int64 + VersionID string + type ArchiveManifest struct + Entries []ArchiveEntry + TotalSize int64 + type ArchiveRequest struct + References []string + type Authorizer interface + Authorize func(context.Context, Principal, string, Access) error + type Binding struct + Module string + ResourceID string + type Config struct + Actor Principal + Clock func() time.Time + MaxArchiveBytes int64 + MaxArchiveFiles int + MaxAttempts int + MaxFilesPerOwner int + MaxOpenUploads int + MaxReferences int + MaxVersions int + OperationTimeout time.Duration + ParallelTransfers int + Profiles map[string]Profile + UnreferencedTTL time.Duration + UploadTTL time.Duration + type Event struct + Actor Principal + Data EventData + DataContentType string + ID string + Revision int64 + Source string + SpecVersion string + Subject string + Time time.Time + Type string + type EventData struct + Revision int64 + type File struct + CreatedAt time.Time + Deleting bool + Disabled bool + ID string + NextVersion int + Owner Principal + Purpose string + Revision int64 + type FileListing struct + Protection Protection + type FilePage struct + Items []File + NextCursor string + type FileView struct + Versions []Version + type Job struct + Attempts int + AvailableAt time.Time + ErrorCode string + Generation int64 + LeaseOwner string + LeaseUntil time.Time + State string + VersionID string + type Principal = storage.Principal + type Profile struct + AllowedTypes []string + MaxSize int64 + Module string + Published Protection + Quarantine Protection + type Protection = storage.Protection + type Reference struct + FileID string + ID string + Module string + ResourceID string + Revision int64 + State string + VersionID string + type Replay struct + Digest string + Key string + Result json.RawMessage + type Repository interface + AcknowledgeEvent func(context.Context, string) error + Claim func(context.Context, string, time.Time, time.Duration) (Job, error) + PendingEvents func(context.Context, int) ([]Event, error) + Transaction func(context.Context, func(Transaction) error) error + type Service struct + func New(r Repository, a Authorizer, store Store, c Config) (*Service, error) + func (s *Service) Approve(ctx context.Context, p Principal, id, key string) (Version, error) + func (s *Service) Archive(ctx context.Context, p Principal, ids []string, dst io.Writer) error + func (s *Service) ArchiveLimits() (files int, bytes int64) + func (s *Service) ArchiveManifest(ctx context.Context, p Principal, ids []string) (ArchiveManifest, error) + func (s *Service) Attach(ctx context.Context, p Principal, id, key string, b Binding) (Reference, error) + func (s *Service) CancelUpload(ctx context.Context, p Principal, id, key string) (Version, error) + func (s *Service) Close(ctx context.Context) error + func (s *Service) CreateUpload(ctx context.Context, p Principal, key string, r UploadRequest) (Version, error) + func (s *Service) DeleteFile(ctx context.Context, p Principal, id, key string, revision int64) (FileView, error) + func (s *Service) Download(ctx context.Context, p Principal, id string, dst io.Writer) error + func (s *Service) GetFile(ctx context.Context, p Principal, id string) (FileView, error) + func (s *Service) GetReference(ctx context.Context, p Principal, id string) (Reference, error) + func (s *Service) GetUpload(ctx context.Context, p Principal, id string) (VersionView, error) + func (s *Service) GetVersion(ctx context.Context, p Principal, id string) (VersionView, error) + func (s *Service) ListFiles(ctx context.Context, p Principal, limit int, cursor string) (FilePage, error) + func (s *Service) Publish(ctx context.Context, p Principal, id, key string) (Reference, error) + func (s *Service) ReferenceVersion(ctx context.Context, p Principal, id string) (Version, error) + func (s *Service) Release(ctx context.Context, p Principal, id, key string) (Reference, error) + func (s *Service) ReviewDownload(ctx context.Context, p Principal, id string, dst io.Writer) error + func (s *Service) RunOne(ctx context.Context, worker string) (bool, error) + func (s *Service) SetFileState(ctx context.Context, p Principal, id, key string, revision int64, ...) (FileView, error) + func (s *Service) Sweep(ctx context.Context, n int, after string) (string, error) + func (s *Service) Upload(ctx context.Context, p Principal, id, key string, src io.Reader) (Version, error) + type Store interface + ChangeProtection func(context.Context, Principal, string, string, int64, Protection) (storage.Status, error) + Create func(context.Context, Principal, string, storage.CreateRequest) (storage.Status, error) + Delete func(context.Context, Principal, string, string, int64) (storage.Status, error) + Download func(context.Context, Principal, string, io.Writer) error + Ingest func(context.Context, Principal, string, string, io.Reader) (storage.Status, error) + Reference func(context.Context, Principal, string, string, storage.Reference, bool) (storage.Status, error) + ReviewDownload func(context.Context, Principal, string, io.Writer) error + Status func(context.Context, Principal, string) (storage.Status, error) + type Transaction interface + Counts func(Principal) (files, open int, err error) + Event func(Event) error + File func(string) (File, error) + Files func(Principal, int, string) ([]FileListing, error) + Job func(string) (Job, error) + Lock func(string) error + Reference func(string) (Version, Reference, error) + Replay func(string) (Replay, error) + ReuseCandidates func(Principal, UploadRequest) ([]Version, error) + SaveFile func(File) error + SaveJob func(Job) error + SaveReplay func(Replay) error + SaveVersion func(Version) error + ScanVersions func(int, string) ([]Version, error) + Upload func(string) (Version, error) + Version func(string) (Version, error) + Versions func(string) ([]Version, error) + type UploadRequest struct + ContentType string + FileID string + Filename string + Purpose string + ReuseExisting bool + SHA256 string + Size int64 + type Version struct + Approved bool + CleanupComplete bool + ContentType string + ErrorCode string + ExpiresAt time.Time + FileID string + Filename string + ID string + Number int + ObjectID string + ObjectIssued bool + Profile Profile + References []Reference + RetainUntil time.Time + ReuseObject string + ReuseSource string + Reused bool + Revision int64 + SHA256 string + Shared bool + Size int64 + State string + TypeValidated bool + UploadGeneration int64 + UploadID string + UploadUntil time.Time + type VersionView struct + Desired int + Healthy int + StorageState string