Help us shape the future of Go! Take the 2026 Go Developer Survey

objectreader

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2026 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidArgument  = errors.New("object reader: invalid argument")
	ErrNoSuchBucket     = errors.New("object reader: bucket not found")
	ErrNoSuchKey        = errors.New("object reader: object not found")
	ErrNoSuchVersion    = errors.New("object reader: object version not found")
	ErrMethodNotAllowed = errors.New("object reader: method not allowed")
	ErrCacheRead        = errors.New("object reader: cache read failed")
	ErrCacheMiss        = errors.New("object reader: cache miss")
	ErrProviderDownload = errors.New("object reader: provider download failed")
)

Functions

func AdminVisibility

func AdminVisibility(status model.BucketStatus) bool

func S3Visibility

func S3Visibility(status model.BucketStatus) bool

Types

type BucketVisibility

type BucketVisibility func(model.BucketStatus) bool

type Reader

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

func New

func New(
	repos *repository.Repositories,
	cache cache.Cache,
	storage synapse.StorageClient,
	cacheGate *cacheaccess.Gate,
	accessTracker *cacheaccess.Tracker,
	logger *slog.Logger,
) *Reader

func (*Reader) Open

func (r *Reader) Open(ctx context.Context, bucketName, key string, visible BucketVisibility) (*Result, error)

func (*Reader) OpenVersion

func (r *Reader) OpenVersion(ctx context.Context, bucketName, key, versionID string, visible BucketVisibility) (*Result, error)

func (*Reader) OpenVersionForCopy

func (r *Reader) OpenVersionForCopy(ctx context.Context, bucketName, key, versionID string, visible BucketVisibility) (*Result, error)

OpenVersionForCopy opens an explicit version without rehydrating a missing source cache entry.

type Result

type Result struct {
	Body           io.ReadCloser
	Size           int64
	ETag           string
	Checksum       string
	VersionID      string
	ContentType    string
	LastModified   time.Time
	Metadata       map[string]string
	SystemMetadata model.ObjectSystemMetadata
	Source         Source
	CacheMiss      bool
}

type Source

type Source string
const (
	SourceCache    Source = "cache"
	SourceProvider Source = "provider"
)

Jump to

Keyboard shortcuts

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