storage

package
v0.31.0 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrRangeNotSatisfiable = s3.ErrRangeNotSatisfiable

ErrRangeNotSatisfiable reports a ranged read whose byte range falls outside the object, so HTTP handlers can answer 416 instead of 500.

Functions

This section is empty.

Types

type Driver

type Driver interface {
	UploadObject(ctx context.Context, key string, fileType string, content io.Reader) (string, error)
	GetObject(ctx context.Context, key string) ([]byte, error)
	// GetObjectStream streams an object; a non-empty byteRange is forwarded as
	// an HTTP Range header and yields a partial object. byteRange must request at
	// most one range because S3 does not support multipart range responses.
	GetObjectStream(ctx context.Context, key string, byteRange string) (*ObjectStream, error)
	DeleteObject(ctx context.Context, key string) error
}

Driver provides object operations for a configured attachment storage.

func NewDriver

func NewDriver(ctx context.Context, configuredStorage *storepb.Storage) (Driver, error)

NewDriver creates the driver for a configured storage.

type ObjectStream

type ObjectStream = s3.ObjectStream

ObjectStream is object content with the metadata needed to answer HTTP range requests. Aliased so driver consumers never import a concrete backend.

type RangeNotSatisfiableError

type RangeNotSatisfiableError = s3.RangeNotSatisfiableError

RangeNotSatisfiableError carries response metadata for an unsatisfied range.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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