Documentation
¶
Index ¶
- Variables
- func AdminVisibility(status model.BucketStatus) bool
- func S3Visibility(status model.BucketStatus) bool
- type BucketVisibility
- type Reader
- func (r *Reader) Open(ctx context.Context, bucketName, key string, visible BucketVisibility, ...) (*Result, error)
- func (r *Reader) OpenVersion(ctx context.Context, bucketName, key, versionID string, ...) (*Result, error)
- func (r *Reader) OpenVersionForCopy(ctx context.Context, bucketName, key, versionID string, ...) (*Result, error)
- type Result
- type Source
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, evictionPolicy cache.EvictionPolicy, logger *slog.Logger, ) *Reader
func (*Reader) Open ¶
func (r *Reader) Open(ctx context.Context, bucketName, key string, visible BucketVisibility, check ...func(*model.ObjectVersion) error) (*Result, error)
func (*Reader) OpenVersion ¶
func (r *Reader) OpenVersion(ctx context.Context, bucketName, key, versionID string, visible BucketVisibility, check ...func(*model.ObjectVersion) error) (*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
}
func (*Result) LimitToRange ¶ added in v0.1.1
LimitToRange narrows Body to length bytes starting at start. A provider body is still read to its end so piece verification decides whether the range completes.
Click to show internal directories.
Click to hide internal directories.