Documentation ¶
Index ¶
- func DeletePrefix(ctx context.Context, bkt objstore.Bucket, prefix string, logger log.Logger) (int, error)
- func NewDelayedBucketClient(wrapped objstore.Bucket, minDelay, maxDelay time.Duration) objstore.Bucket
- type Bucket
- type BucketReader
- type DelayedBucketClient
- func (m *DelayedBucketClient) Attributes(ctx context.Context, name string) (objstore.ObjectAttributes, error)
- func (m *DelayedBucketClient) Close() error
- func (m *DelayedBucketClient) Delete(ctx context.Context, name string) error
- func (m *DelayedBucketClient) Exists(ctx context.Context, name string) (bool, error)
- func (m *DelayedBucketClient) Get(ctx context.Context, name string) (io.ReadCloser, error)
- func (m *DelayedBucketClient) GetRange(ctx context.Context, name string, off, length int64) (io.ReadCloser, error)
- func (m *DelayedBucketClient) IsObjNotFoundErr(err error) bool
- func (m *DelayedBucketClient) Iter(ctx context.Context, dir string, f func(string) error, ...) error
- func (m *DelayedBucketClient) Name() string
- func (m *DelayedBucketClient) Upload(ctx context.Context, name string, r io.Reader) error
- type InstrumentedBucket
- type MetricBucket
- type ReaderAt
- type ReaderAtCreator
- type SSEBucketClient
- func (b *SSEBucketClient) Attributes(ctx context.Context, name string) (objstore.ObjectAttributes, error)
- func (b *SSEBucketClient) Close() error
- func (b *SSEBucketClient) Delete(ctx context.Context, name string) error
- func (b *SSEBucketClient) Exists(ctx context.Context, name string) (bool, error)
- func (b *SSEBucketClient) Get(ctx context.Context, name string) (io.ReadCloser, error)
- func (b *SSEBucketClient) GetRange(ctx context.Context, name string, off, length int64) (io.ReadCloser, error)
- func (b *SSEBucketClient) IsObjNotFoundErr(err error) bool
- func (b *SSEBucketClient) Iter(ctx context.Context, dir string, f func(string) error, ...) error
- func (b *SSEBucketClient) Name() string
- func (b *SSEBucketClient) ReaderWithExpectedErrs(fn objstore.IsOpFailureExpectedFunc) objstore.BucketReader
- func (b *SSEBucketClient) Upload(ctx context.Context, name string, r io.Reader) error
- func (b *SSEBucketClient) WithExpectedErrs(fn objstore.IsOpFailureExpectedFunc) objstore.Bucket
- type TenantConfigProvider
- type TracingBucket
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Bucket ¶
type Bucket interface { objstore.Bucket ReaderAt(ctx context.Context, filename string) (ReaderAt, error) }
func BucketWithPrefix ¶
type BucketReader ¶
type BucketReader interface { objstore.BucketReader ReaderAtCreator }
func BucketReaderWithPrefix ¶
func BucketReaderWithPrefix(r BucketReader, prefix string) BucketReader
type DelayedBucketClient ¶
type DelayedBucketClient struct {
// contains filtered or unexported fields
}
DelayedBucketClient wraps objstore.InstrumentedBucket and add a random delay to each API call. This client is intended to be used only for testing purposes.
func (*DelayedBucketClient) Attributes ¶
func (m *DelayedBucketClient) Attributes(ctx context.Context, name string) (objstore.ObjectAttributes, error)
func (*DelayedBucketClient) Close ¶
func (m *DelayedBucketClient) Close() error
func (*DelayedBucketClient) Delete ¶
func (m *DelayedBucketClient) Delete(ctx context.Context, name string) error
func (*DelayedBucketClient) Get ¶
func (m *DelayedBucketClient) Get(ctx context.Context, name string) (io.ReadCloser, error)
func (*DelayedBucketClient) GetRange ¶
func (m *DelayedBucketClient) GetRange(ctx context.Context, name string, off, length int64) (io.ReadCloser, error)
func (*DelayedBucketClient) IsObjNotFoundErr ¶
func (m *DelayedBucketClient) IsObjNotFoundErr(err error) bool
func (*DelayedBucketClient) Iter ¶
func (m *DelayedBucketClient) Iter(ctx context.Context, dir string, f func(string) error, options ...objstore.IterOption) error
func (*DelayedBucketClient) Name ¶
func (m *DelayedBucketClient) Name() string
type InstrumentedBucket ¶
type InstrumentedBucket interface { Bucket // WithExpectedErrs allows to specify a filter that marks certain errors as expected, so it will not increment // thanos_objstore_bucket_operation_failures_total metric. WithExpectedErrs(objstore.IsOpFailureExpectedFunc) Bucket // ReaderWithExpectedErrs allows to specify a filter that marks certain errors as expected, so it will not increment // thanos_objstore_bucket_operation_failures_total metric. // TODO(bwplotka): Remove this when moved to Go 1.14 and replace with InstrumentedBucketReader. ReaderWithExpectedErrs(objstore.IsOpFailureExpectedFunc) BucketReader }
InstrumentedBucket is a Bucket with optional instrumentation control on reader.
func NewMetricBucket ¶
func NewMetricBucket(bkt Bucket, reg prometheus.Registerer) InstrumentedBucket
func NewTracingBucket ¶
func NewTracingBucket(bkt Bucket) InstrumentedBucket
type MetricBucket ¶
type MetricBucket struct { objstore.InstrumentedBucket // contains filtered or unexported fields }
TracingBucket includes bucket operations in the traces.
func (MetricBucket) ReaderWithExpectedErrs ¶
func (t MetricBucket) ReaderWithExpectedErrs(expectedFunc objstore.IsOpFailureExpectedFunc) BucketReader
func (MetricBucket) WithExpectedErrs ¶
func (t MetricBucket) WithExpectedErrs(expectedFunc objstore.IsOpFailureExpectedFunc) Bucket
type ReaderAtCreator ¶
type SSEBucketClient ¶
type SSEBucketClient struct {
// contains filtered or unexported fields
}
SSEBucketClient is a wrapper around a objstore.BucketReader that configures the object storage server-side encryption (SSE) for a given user.
func NewSSEBucketClient ¶
func NewSSEBucketClient(userID string, bucket objstore.Bucket, cfgProvider TenantConfigProvider) *SSEBucketClient
NewSSEBucketClient makes a new SSEBucketClient. The cfgProvider can be nil.
func (*SSEBucketClient) Attributes ¶
func (b *SSEBucketClient) Attributes(ctx context.Context, name string) (objstore.ObjectAttributes, error)
Attributes implements objstore.Bucket.
func (*SSEBucketClient) Close ¶
func (b *SSEBucketClient) Close() error
Close implements objstore.Bucket.
func (*SSEBucketClient) Delete ¶
func (b *SSEBucketClient) Delete(ctx context.Context, name string) error
Delete implements objstore.Bucket.
func (*SSEBucketClient) Get ¶
func (b *SSEBucketClient) Get(ctx context.Context, name string) (io.ReadCloser, error)
Get implements objstore.Bucket.
func (*SSEBucketClient) GetRange ¶
func (b *SSEBucketClient) GetRange(ctx context.Context, name string, off, length int64) (io.ReadCloser, error)
GetRange implements objstore.Bucket.
func (*SSEBucketClient) IsObjNotFoundErr ¶
func (b *SSEBucketClient) IsObjNotFoundErr(err error) bool
IsObjNotFoundErr implements objstore.Bucket.
func (*SSEBucketClient) Iter ¶
func (b *SSEBucketClient) Iter(ctx context.Context, dir string, f func(string) error, options ...objstore.IterOption) error
Iter implements objstore.Bucket.
func (*SSEBucketClient) Name ¶
func (b *SSEBucketClient) Name() string
Name implements objstore.Bucket.
func (*SSEBucketClient) ReaderWithExpectedErrs ¶
func (b *SSEBucketClient) ReaderWithExpectedErrs(fn objstore.IsOpFailureExpectedFunc) objstore.BucketReader
ReaderWithExpectedErrs implements objstore.Bucket.
func (*SSEBucketClient) WithExpectedErrs ¶
func (b *SSEBucketClient) WithExpectedErrs(fn objstore.IsOpFailureExpectedFunc) objstore.Bucket
WithExpectedErrs implements objstore.Bucket.
type TenantConfigProvider ¶
type TenantConfigProvider interface { // S3SSEType returns the per-tenant S3 SSE type. S3SSEType(userID string) string // S3SSEKMSKeyID returns the per-tenant S3 KMS-SSE key id or an empty string if not set. S3SSEKMSKeyID(userID string) string // S3SSEKMSEncryptionContext returns the per-tenant S3 KMS-SSE key id or an empty string if not set. S3SSEKMSEncryptionContext(userID string) string }
TenantConfigProvider defines a per-tenant config provider.
type TracingBucket ¶
type TracingBucket struct { objstore.InstrumentedBucket // contains filtered or unexported fields }
TracingBucket includes bucket operations in the traces.
func (TracingBucket) ReaderWithExpectedErrs ¶
func (t TracingBucket) ReaderWithExpectedErrs(expectedFunc objstore.IsOpFailureExpectedFunc) BucketReader
func (TracingBucket) WithExpectedErrs ¶
func (t TracingBucket) WithExpectedErrs(expectedFunc objstore.IsOpFailureExpectedFunc) Bucket