memory

package
v1.24.0 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewInMemory

func NewInMemory() blob.Store

NewInMemory returns an in-memory blob.Store for tests.

func NewInMemoryAccessStore

func NewInMemoryAccessStore() blob.AccessStore

NewInMemoryAccessStore returns an in-memory blob.AccessStore for tests.

Types

type Storage

type Storage struct {
	sync.Mutex
	// contains filtered or unexported fields
}

Storage is an in-memory blob.ObjectStorage for tests. It stands in for the two-bucket S3 + CloudFront backend: uploaded bytes land in the upload store, Promote moves validated bytes into the origin store, and SignDownloadURL mints a fake CDN URL for the served bytes.

func NewInMemoryStorage

func NewInMemoryStorage() *Storage

NewInMemoryStorage returns an in-memory blob.ObjectStorage for tests.

func (*Storage) CopyToOrigin

func (s *Storage) CopyToOrigin(_ context.Context, key string) error

func (*Storage) DeleteUpload

func (s *Storage) DeleteUpload(_ context.Context, key string) error

func (*Storage) GetUploaded

func (s *Storage) GetUploaded(_ context.Context, key string) ([]byte, error)

func (*Storage) PresignUpload

func (s *Storage) PresignUpload(_ context.Context, key, mimeType string, sizeBytes uint64) (*blobpb.UploadTarget, error)

func (*Storage) PutObject

func (s *Storage) PutObject(key string, data []byte)

PutObject stores bytes directly into the upload store, bypassing the presign dance.

func (*Storage) PutOrigin added in v1.22.0

func (s *Storage) PutOrigin(_ context.Context, key, _ string, data []byte) error

func (*Storage) SignDownloadURL

func (s *Storage) SignDownloadURL(_ context.Context, key string) (*blobpb.DownloadUrl, error)

func (*Storage) SimulateUpload

func (s *Storage) SimulateUpload(target *blobpb.UploadTarget, data []byte)

SimulateUpload stores bytes as if the client had POSTed them to the presigned target, keyed by the target's "key" form field.

func (*Storage) UploadExists added in v1.22.0

func (s *Storage) UploadExists(_ context.Context, key string) (bool, error)

Jump to

Keyboard shortcuts

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