Documentation
¶
Index ¶
- func NewInMemory() blob.Store
- func NewInMemoryAccessStore() blob.AccessStore
- type Storage
- func (s *Storage) CopyToOrigin(_ context.Context, key string) error
- func (s *Storage) DeleteUpload(_ context.Context, key string) error
- func (s *Storage) GetUploaded(_ context.Context, key string) ([]byte, error)
- func (s *Storage) PresignUpload(_ context.Context, key, mimeType string, sizeBytes uint64) (*blobpb.UploadTarget, error)
- func (s *Storage) PutObject(key string, data []byte)
- func (s *Storage) PutOrigin(_ context.Context, key, _ string, data []byte) error
- func (s *Storage) SignDownloadURL(_ context.Context, key string) (*blobpb.DownloadUrl, error)
- func (s *Storage) SimulateUpload(target *blobpb.UploadTarget, data []byte)
- func (s *Storage) UploadExists(_ context.Context, key string) (bool, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewInMemory ¶
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 ¶
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) GetUploaded ¶
func (*Storage) PresignUpload ¶
func (*Storage) PutObject ¶
PutObject stores bytes directly into the upload store, bypassing the presign dance.
func (*Storage) SignDownloadURL ¶
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.