package objstore

Import Path
	github.com/thanos-io/objstore (on go.dev)

Dependency Relation
	imports 24 packages, and imported by 5 packages


Package-Level Type Names (total 15)
/* sort by: | */
Bucket provides read and write access to an object storage bucket. NOTE: We assume strong consistency for write-read flow. Attributes returns information about the specified object. ( Bucket) Close() error Delete removes the object with the given name. If object does not exist in the moment of deletion, Delete should throw error. Exists checks if the given object exists in the bucket. Get returns a reader for the given object name. GetRange returns a new range reader for the given object name and range. IsAccessDeniedErr returns true if access to object is denied. IsObjNotFoundErr returns true if error means that object is not found. Relevant to Get operations. Iter calls f for each entry in the given directory (not recursive.). The argument to f is the full object name including the prefix of the inspected directory. Entries are passed to function in sorted order. Name returns the bucket name for the provider. Upload the contents of the reader as an object into the bucket. Upload should be idempotent. *InMemBucket InstrumentedBucket (interface) *PrefixedBucket github.com/polarsignals/frostdb.DefaultObjstoreBucket github.com/polarsignals/frostdb/storage.Bucket (interface) github.com/polarsignals/frostdb/storage.BucketReaderAt github.com/polarsignals/frostdb/storage.FileReaderAt Bucket : BucketReader Bucket : github.com/polarsignals/frostdb/query/logicalplan.Named Bucket : github.com/prometheus/common/expfmt.Closer Bucket : io.Closer func NewPrefixedBucket(bkt Bucket, prefix string) Bucket func WithDelay(bkt Bucket, delay time.Duration) Bucket func InstrumentedBucket.WithExpectedErrs(IsOpFailureExpectedFunc) Bucket func github.com/polarsignals/iceberg-go/table.Table.Bucket() Bucket func AcceptanceTest(t *testing.T, bkt Bucket) func EmptyBucket(t testing.TB, ctx context.Context, bkt Bucket) func NewPrefixedBucket(bkt Bucket, prefix string) Bucket func UploadDir(ctx context.Context, logger log.Logger, bkt Bucket, srcdir, dstdir string, options ...UploadOption) error func UploadFile(ctx context.Context, logger log.Logger, bkt Bucket, src, dst string) error func WithDelay(bkt Bucket, delay time.Duration) Bucket func WithNoopInstr(bkt Bucket) InstrumentedBucket func WrapWith(b Bucket, metrics *Metrics) *metricBucket func WrapWithMetrics(b Bucket, reg prometheus.Registerer, name string) *metricBucket func github.com/polarsignals/frostdb.NewDefaultObjstoreBucket(b Bucket, options ...frostdb.DefaultObjstoreBucketOption) *frostdb.DefaultObjstoreBucket func github.com/polarsignals/frostdb/storage.NewBucketReaderAt(bucket Bucket) *storage.BucketReaderAt func github.com/polarsignals/frostdb/storage.NewIceberg(uri string, ctlg catalog.Catalog, bucket Bucket, options ...storage.IcebergOption) (*storage.Iceberg, error) func github.com/polarsignals/iceberg-go.ManifestFile.FetchEntries(bucket Bucket, discardDeleted bool) ([]iceberg.ManifestEntry, *iceberg.Schema, error) func github.com/polarsignals/iceberg-go/catalog.NewHDFS(uri string, bucket Bucket) catalog.Catalog func github.com/polarsignals/iceberg-go/catalog.NewIcebucket(warehouseURI string, bucket Bucket) *catalog.icebucket func github.com/polarsignals/iceberg-go/table.New(ident table.Identifier, meta table.Metadata, location string, bucket Bucket) table.Table func github.com/polarsignals/iceberg-go/table.NewFromLocation(ident table.Identifier, metalocation string, bucket Bucket) (table.Table, error) func github.com/polarsignals/iceberg-go/table.NewHDFSTable(ver int, ident table.Identifier, meta table.Metadata, location string, bucket Bucket) table.Table func github.com/polarsignals/iceberg-go/table.NewSnapshotWriter(commit func(ctx context.Context, v int) error, version int, bucket Bucket, table table.Table, options ...table.WriterOption) table.snapshotWriter func github.com/polarsignals/iceberg-go/table.Snapshot.Manifests(bucket Bucket) ([]iceberg.ManifestFile, error)
BucketReader provides read access to an object storage bucket. Attributes returns information about the specified object. Exists checks if the given object exists in the bucket. Get returns a reader for the given object name. GetRange returns a new range reader for the given object name and range. IsAccessDeniedErr returns true if access to object is denied. IsObjNotFoundErr returns true if error means that object is not found. Relevant to Get operations. Iter calls f for each entry in the given directory (not recursive.). The argument to f is the full object name including the prefix of the inspected directory. Entries are passed to function in sorted order. Bucket (interface) *InMemBucket InstrumentedBucket (interface) InstrumentedBucketReader (interface) *PrefixedBucket github.com/polarsignals/frostdb.DefaultObjstoreBucket github.com/polarsignals/frostdb/storage.Bucket (interface) github.com/polarsignals/frostdb/storage.BucketReaderAt github.com/polarsignals/frostdb/storage.FileReaderAt func InstrumentedBucket.ReaderWithExpectedErrs(IsOpFailureExpectedFunc) BucketReader func InstrumentedBucketReader.ReaderWithExpectedErrs(IsOpFailureExpectedFunc) BucketReader func DownloadDir(ctx context.Context, logger log.Logger, bkt BucketReader, originalSrc, src, dst string, options ...DownloadOption) error func DownloadFile(ctx context.Context, logger log.Logger, bkt BucketReader, src, dst string) (err error)
DownloadOption configures the provided params. func WithDownloadIgnoredPaths(ignoredPaths ...string) DownloadOption func WithFetchConcurrency(concurrency int) DownloadOption func DownloadDir(ctx context.Context, logger log.Logger, bkt BucketReader, originalSrc, src, dst string, options ...DownloadOption) error
InMemBucket implements the objstore.Bucket interfaces against local memory. Methods from Bucket interface are thread-safe. Objects are assumed to be immutable. Attributes returns information about the specified object. (*InMemBucket) Close() error Delete removes all data prefixed with the dir. Exists checks if the given directory exists in memory. Get returns a reader for the given object name. GetRange returns a new range reader for the given object name and range. IsAccessDeniedErr returns true if access to object is denied. IsObjNotFoundErr returns true if error means that object is not found. Relevant to Get operations. Iter calls f for each entry in the given directory. The argument to f is the full object name including the prefix of the inspected directory. Name returns the bucket name. Objects returns a copy of the internally stored objects. NOTE: For assert purposes. Upload writes the file specified in src to into the memory. *InMemBucket : Bucket *InMemBucket : BucketReader *InMemBucket : github.com/polarsignals/frostdb/query/logicalplan.Named *InMemBucket : github.com/prometheus/common/expfmt.Closer *InMemBucket : io.Closer func NewInMemBucket() *InMemBucket
InstrumentedBucket is a Bucket with optional instrumentation control on reader. Attributes returns information about the specified object. ( InstrumentedBucket) Close() error Delete removes the object with the given name. If object does not exist in the moment of deletion, Delete should throw error. Exists checks if the given object exists in the bucket. Get returns a reader for the given object name. GetRange returns a new range reader for the given object name and range. IsAccessDeniedErr returns true if access to object is denied. IsObjNotFoundErr returns true if error means that object is not found. Relevant to Get operations. Iter calls f for each entry in the given directory (not recursive.). The argument to f is the full object name including the prefix of the inspected directory. Entries are passed to function in sorted order. Name returns the bucket name for the provider. ReaderWithExpectedErrs allows to specify a filter that marks certain errors as expected, so it will not increment objstore_bucket_operation_failures_total metric. TODO(bwplotka): Remove this when moved to Go 1.14 and replace with InstrumentedBucketReader. Upload the contents of the reader as an object into the bucket. Upload should be idempotent. WithExpectedErrs allows to specify a filter that marks certain errors as expected, so it will not increment objstore_bucket_operation_failures_total metric. InstrumentedBucket : Bucket InstrumentedBucket : BucketReader InstrumentedBucket : InstrumentedBucketReader InstrumentedBucket : github.com/polarsignals/frostdb/query/logicalplan.Named InstrumentedBucket : github.com/prometheus/common/expfmt.Closer InstrumentedBucket : io.Closer func WithNoopInstr(bkt Bucket) InstrumentedBucket
InstrumentedBucketReader is a BucketReader with optional instrumentation control. Attributes returns information about the specified object. Exists checks if the given object exists in the bucket. Get returns a reader for the given object name. GetRange returns a new range reader for the given object name and range. IsAccessDeniedErr returns true if access to object is denied. IsObjNotFoundErr returns true if error means that object is not found. Relevant to Get operations. Iter calls f for each entry in the given directory (not recursive.). The argument to f is the full object name including the prefix of the inspected directory. Entries are passed to function in sorted order. ReaderWithExpectedErrs allows to specify a filter that marks certain errors as expected, so it will not increment objstore_bucket_operation_failures_total metric. InstrumentedBucket (interface) InstrumentedBucketReader : BucketReader
IsOpFailureExpectedFunc allows to mark certain errors as expected, so they will not increment objstore_bucket_operation_failures_total metric. func InstrumentedBucket.ReaderWithExpectedErrs(IsOpFailureExpectedFunc) BucketReader func InstrumentedBucket.WithExpectedErrs(IsOpFailureExpectedFunc) Bucket func InstrumentedBucketReader.ReaderWithExpectedErrs(IsOpFailureExpectedFunc) BucketReader
IterOption configures the provided params. func ApplyIterOptions(options ...IterOption) IterParams func Bucket.Iter(ctx context.Context, dir string, f func(string) error, options ...IterOption) error func BucketReader.Iter(ctx context.Context, dir string, f func(string) error, options ...IterOption) error func (*InMemBucket).Iter(_ context.Context, dir string, f func(string) error, options ...IterOption) error func InstrumentedBucket.Iter(ctx context.Context, dir string, f func(string) error, options ...IterOption) error func InstrumentedBucketReader.Iter(ctx context.Context, dir string, f func(string) error, options ...IterOption) error func (*PrefixedBucket).Iter(ctx context.Context, dir string, f func(string) error, options ...IterOption) error func github.com/polarsignals/frostdb/storage.Bucket.Iter(ctx context.Context, dir string, f func(string) error, options ...IterOption) error
IterParams holds the Iter() parameters and is used by objstore clients implementations. Recursive bool func ApplyIterOptions(options ...IterOption) IterParams func WithRecursiveIter(params *IterParams)
func BucketMetrics(reg prometheus.Registerer, name string) *Metrics func WrapWith(b Bucket, metrics *Metrics) *metricBucket
LastModified is the timestamp the object was last modified. Size is the object size in bytes. func Bucket.Attributes(ctx context.Context, name string) (ObjectAttributes, error) func BucketReader.Attributes(ctx context.Context, name string) (ObjectAttributes, error) func (*InMemBucket).Attributes(_ context.Context, name string) (ObjectAttributes, error) func InstrumentedBucket.Attributes(ctx context.Context, name string) (ObjectAttributes, error) func InstrumentedBucketReader.Attributes(ctx context.Context, name string) (ObjectAttributes, error) func PrefixedBucket.Attributes(ctx context.Context, name string) (ObjectAttributes, error) func github.com/polarsignals/frostdb/storage.Bucket.Attributes(ctx context.Context, name string) (ObjectAttributes, error)
ObjectSizer can return size of object. ObjectSize returns the size of the object in bytes, or error if it is not available.
Attributes returns information about the specified object. (*PrefixedBucket) Close() error Delete removes the object with the given name. If object does not exists in the moment of deletion, Delete should throw error. Exists checks if the given object exists in the bucket. Get returns a reader for the given object name. GetRange returns a new range reader for the given object name and range. IsAccessDeniedErr returns true if access to object is denied. IsObjNotFoundErr returns true if error means that object is not found. Relevant to Get operations. Iter calls f for each entry in the given directory (not recursive.). The argument to f is the full object name including the prefix of the inspected directory. Entries are passed to function in sorted order. Name returns the bucket name for the provider. Upload the contents of the reader as an object into the bucket. Upload should be idempotent. *PrefixedBucket : Bucket *PrefixedBucket : BucketReader *PrefixedBucket : github.com/polarsignals/frostdb/query/logicalplan.Named *PrefixedBucket : github.com/prometheus/common/expfmt.Closer *PrefixedBucket : io.Closer
TLSConfig configures the options for TLS connections. The CA cert to use for the targets. The client cert file for the targets. Disable target certificate validation. The client key file for the targets. Used to verify the hostname for the targets. func NewTLSConfig(cfg *TLSConfig) (*tls.Config, error)
UploadOption configures the provided params. func WithUploadConcurrency(concurrency int) UploadOption func UploadDir(ctx context.Context, logger log.Logger, bkt Bucket, srcdir, dstdir string, options ...UploadOption) error
Package-Level Functions (total 22)
DownloadDir downloads all object found in the directory into the local directory.
DownloadFile downloads the src file from the bucket to dst. If dst is an existing directory, a file with the same name as the source is created in dst. If destination file is already existing, download file will overwrite it.
EmptyBucket deletes all objects from bucket. This operation is required to properly delete bucket as a whole. It is used for testing only. TODO(bplotka): Add retries.
NewInMemBucket returns a new in memory Bucket. NOTE: Returned bucket is just a naive in memory bucket implementation. For test use cases only.
NewTLSConfig creates a new tls.Config from the given TLSConfig.
NopCloserWithSize returns a ReadCloser with a no-op Close method wrapping the provided Reader r. Returned ReadCloser also implements Size method.
TryToGetSize tries to get upfront size from reader. Some implementations may return only size of unread data in the reader, so it's best to call this method before doing any reading. TODO(https://github.com/thanos-io/thanos/issues/678): Remove guessing length when minio provider will support multipart upload without this.
UploadDir uploads all files in srcdir to the bucket with into a top-level directory named dstdir. It is a caller responsibility to clean partial upload in case of failure.
UploadFile uploads the file with the given name to the bucket. It is a caller responsibility to clean partial upload in case of failure.
func WithDelay(bkt Bucket, delay time.Duration) Bucket
WithDownloadIgnoredPaths is an option to set the paths to not be downloaded.
WithFetchConcurrency is an option to set the concurrency of the download operation.
WithRecursiveIter is an option that can be applied to Iter() to recursively list objects in the bucket.
WithUploadConcurrency is an option to set the concurrency of the upload operation.
WrapWith takes a `bucket` and `metrics` that returns instrumented bucket. Similar to WrapWithMetrics, but `metrics` can be passed separately as an argument.
WrapWithMetrics takes a bucket and registers metrics with the given registry for operations run against the bucket.
Package-Level Constants (total 8)
DirDelim is the delimiter used to model a directory structure in an object store bucket.
const OpAttributes = "attributes"
const OpDelete = "delete"
const OpExists = "exists"
const OpGet = "get"
const OpGetRange = "get_range"
const OpIter = "iter"
const OpUpload = "upload"