Documentation ¶
Index ¶
- Constants
- func NewBucketClient(cfg Config, name string, logger log.Logger) (objstore.Bucket, error)
- func NewBucketReaderClient(cfg Config, name string, logger log.Logger) (objstore.BucketReader, error)
- func NewBucketWithRetries(bucket objstore.Bucket, operationRetries int, retryMinBackoff time.Duration, ...) (objstore.Bucket, error)
- type BucketWithRetries
- func (b *BucketWithRetries) Attributes(ctx context.Context, name string) (attributes objstore.ObjectAttributes, err error)
- func (b *BucketWithRetries) Close() error
- func (b *BucketWithRetries) Delete(ctx context.Context, name string) error
- func (b *BucketWithRetries) Exists(ctx context.Context, name string) (exists bool, err error)
- func (b *BucketWithRetries) Get(ctx context.Context, name string) (reader io.ReadCloser, err error)
- func (b *BucketWithRetries) GetRange(ctx context.Context, name string, off, length int64) (closer io.ReadCloser, err error)
- func (b *BucketWithRetries) IsAccessDeniedErr(err error) bool
- func (b *BucketWithRetries) IsObjNotFoundErr(err error) bool
- func (b *BucketWithRetries) Iter(ctx context.Context, dir string, f func(string) error, ...) error
- func (b *BucketWithRetries) Name() string
- func (b *BucketWithRetries) Upload(ctx context.Context, name string, r io.Reader) error
- type Config
- type HTTPConfig
- type SSEConfig
- func (cfg *SSEConfig) BuildMinioConfig() (encrypt.ServerSide, error)
- func (cfg *SSEConfig) BuildThanosConfig() (s3.SSEConfig, error)
- func (cfg *SSEConfig) RegisterFlags(f *flag.FlagSet)
- func (cfg *SSEConfig) RegisterFlagsWithPrefix(prefix string, f *flag.FlagSet)
- func (cfg *SSEConfig) Validate() error
Constants ¶
const ( SignatureVersionV4 = "v4" SignatureVersionV2 = "v2" // SSEKMS config type constant to configure S3 server side encryption using KMS // https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingKMSEncryption.html SSEKMS = "SSE-KMS" // SSES3 config type constant to configure S3 server side encryption with AES-256 // https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingServerSideEncryption.html SSES3 = "SSE-S3" BucketAutoLookup = "auto" BucketVirtualHostLookup = "virtual-hosted" BucketPathLookup = "path" )
Variables ¶
This section is empty.
Functions ¶
func NewBucketClient ¶
NewBucketClient creates a new S3 bucket client
func NewBucketReaderClient ¶
func NewBucketReaderClient(cfg Config, name string, logger log.Logger) (objstore.BucketReader, error)
NewBucketReaderClient creates a new S3 bucket client
Types ¶
type BucketWithRetries ¶ added in v1.15.0
type BucketWithRetries struct {
// contains filtered or unexported fields
}
func (*BucketWithRetries) Attributes ¶ added in v1.15.0
func (b *BucketWithRetries) Attributes(ctx context.Context, name string) (attributes objstore.ObjectAttributes, err error)
func (*BucketWithRetries) Close ¶ added in v1.15.0
func (b *BucketWithRetries) Close() error
func (*BucketWithRetries) Delete ¶ added in v1.15.0
func (b *BucketWithRetries) Delete(ctx context.Context, name string) error
func (*BucketWithRetries) Get ¶ added in v1.15.0
func (b *BucketWithRetries) Get(ctx context.Context, name string) (reader io.ReadCloser, err error)
func (*BucketWithRetries) GetRange ¶ added in v1.15.0
func (b *BucketWithRetries) GetRange(ctx context.Context, name string, off, length int64) (closer io.ReadCloser, err error)
func (*BucketWithRetries) IsAccessDeniedErr ¶ added in v1.16.0
func (b *BucketWithRetries) IsAccessDeniedErr(err error) bool
func (*BucketWithRetries) IsObjNotFoundErr ¶ added in v1.15.0
func (b *BucketWithRetries) IsObjNotFoundErr(err error) bool
func (*BucketWithRetries) Iter ¶ added in v1.15.0
func (b *BucketWithRetries) Iter(ctx context.Context, dir string, f func(string) error, options ...objstore.IterOption) error
func (*BucketWithRetries) Name ¶ added in v1.15.0
func (b *BucketWithRetries) Name() string
type Config ¶
type Config struct { Endpoint string `yaml:"endpoint"` Region string `yaml:"region"` BucketName string `yaml:"bucket_name"` SecretAccessKey flagext.Secret `yaml:"secret_access_key"` AccessKeyID string `yaml:"access_key_id"` Insecure bool `yaml:"insecure"` SignatureVersion string `yaml:"signature_version"` BucketLookupType string `yaml:"bucket_lookup_type"` SendContentMd5 bool `yaml:"send_content_md5"` SSE SSEConfig `yaml:"sse"` HTTP HTTPConfig `yaml:"http"` }
Config holds the config options for an S3 backend
func (*Config) RegisterFlags ¶
RegisterFlags registers the flags for s3 storage with the provided prefix
func (*Config) RegisterFlagsWithPrefix ¶
RegisterFlagsWithPrefix registers the flags for s3 storage with the provided prefix
type HTTPConfig ¶
type HTTPConfig struct { bucket_http.Config `yaml:",inline"` // Allow upstream callers to inject a round tripper Transport http.RoundTripper `yaml:"-"` }
HTTPConfig stores the http.Transport configuration for the s3 minio client.
func (*HTTPConfig) RegisterFlagsWithPrefix ¶
func (cfg *HTTPConfig) RegisterFlagsWithPrefix(prefix string, f *flag.FlagSet)
RegisterFlagsWithPrefix registers the flags for s3 storage with the provided prefix
type SSEConfig ¶ added in v1.8.0
type SSEConfig struct { Type string `yaml:"type"` KMSKeyID string `yaml:"kms_key_id"` KMSEncryptionContext string `yaml:"kms_encryption_context"` }
SSEConfig configures S3 server side encryption struct that is going to receive user input (through config file or CLI)
func (*SSEConfig) BuildMinioConfig ¶ added in v1.8.0
func (cfg *SSEConfig) BuildMinioConfig() (encrypt.ServerSide, error)
BuildMinioConfig builds the SSE config expected by the Minio client.
func (*SSEConfig) BuildThanosConfig ¶ added in v1.8.0
BuildThanosConfig builds the SSE config expected by the Thanos client.
func (*SSEConfig) RegisterFlags ¶ added in v1.8.0
func (*SSEConfig) RegisterFlagsWithPrefix ¶ added in v1.8.0
RegisterFlagsWithPrefix adds the flags required to config this to the given FlagSet