upload

package
v0.0.0-...-627e41f Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2026 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidateAdministratorReason

func ValidateAdministratorReason(reason string, publicAssetBaseURL *url.URL) error

Types

type AdministratorHooks

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

AdministratorHooks supplies metadata-only operations to AdminService. It intentionally exposes neither staging keys nor signed URLs.

func NewAdministratorHooks

func NewAdministratorHooks(service *Service) *AdministratorHooks

func (*AdministratorHooks) GetUsage

func (h *AdministratorHooks) GetUsage(ctx context.Context, ownerID string) (domain.UploadUsage, error)

func (*AdministratorHooks) ListUploads

func (h *AdministratorHooks) ListUploads(ctx context.Context, actorID string, filters domain.AdminUploadFilters, pageToken string, pageSize uint32) (domain.UploadList, string, error)

func (*AdministratorHooks) RemoveUpload

func (h *AdministratorHooks) RemoveUpload(ctx context.Context, actorID, uploadID string, reason domain.RemovalReason, expected domain.UploadState, rationale string, event domain.AuditEvent) (domain.Upload, error)

type CursorCodec

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

func NewCursorCodec

func NewCursorCodec(key []byte) (*CursorCodec, error)

func (*CursorCodec) Decode

func (c *CursorCodec) Decode(token, owner string, states []domain.UploadState, submission string, now time.Time) (domain.UploadCursor, error)

func (*CursorCodec) DecodeAdministrator

func (c *CursorCodec) DecodeAdministrator(token, actor string, filters domain.AdminUploadFilters, now time.Time) (domain.UploadCursor, error)

func (*CursorCodec) Encode

func (c *CursorCodec) Encode(owner string, states []domain.UploadState, submission string, cursor domain.UploadCursor, now time.Time) (string, error)

func (*CursorCodec) EncodeAdministrator

func (c *CursorCodec) EncodeAdministrator(actor string, filters domain.AdminUploadFilters, cursor domain.UploadCursor, now time.Time) (string, error)

type Service

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

func NewService

func NewService(repository domain.UploadRepository, objects domain.UploadStorage, cache domain.UploadCache, cursors *CursorCodec, clock domain.Clock, logger *slog.Logger, publicBaseURL string, removalPNG []byte) *Service

func (*Service) Create

func (s *Service) Create(ctx context.Context, ownerID string, target domain.UploadTarget, size uint64, checksum [32]byte) (domain.UploadReservation, error)

func (*Service) Delete

func (s *Service) Delete(ctx context.Context, ownerID, uploadID string) (domain.Upload, error)

func (*Service) Finalize

func (s *Service) Finalize(ctx context.Context, ownerID string, binding domain.UploadBinding) (domain.Upload, error)

func (*Service) List

func (s *Service) List(ctx context.Context, ownerID string, states []domain.UploadState, submissionID, pageToken string, pageSize uint32) (domain.UploadList, string, error)

func (*Service) PublicURL

func (s *Service) PublicURL(publicID string) string

func (*Service) PurgeAccount

func (s *Service) PurgeAccount(ctx context.Context, user domain.User) error

func (*Service) RemoveAsAdministrator

func (s *Service) RemoveAsAdministrator(ctx context.Context, actorID, uploadID string, reason domain.RemovalReason, expected domain.UploadState, rationale string, event domain.AuditEvent) (domain.Upload, error)

func (*Service) SweepExpiredUploads

func (s *Service) SweepExpiredUploads(ctx context.Context, now time.Time, limit int) (domain.StagingSweepResult, error)

Jump to

Keyboard shortcuts

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