s3

package
v0.9.8 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2021 License: Apache-2.0 Imports: 19 Imported by: 3

Documentation

Overview

Package s3 implements Storage based on an S3 bucket.

Index

Constants

View Source
const ConfigName = ".storageconfig"

ConfigName is the name of the hidden storage config file in a S3 bucket.

Variables

This section is empty.

Functions

func New

func New(ctx context.Context, opt *Options) (blob.Storage, error)

New creates new S3-backed storage with specified options:

- the 'BucketName' field is required and all other parameters are optional.

Types

type Options

type Options struct {
	// BucketName is the name of the bucket where data is stored.
	BucketName string `json:"bucket"`

	// Prefix specifies additional string to prepend to all objects.
	Prefix string `json:"prefix,omitempty"`

	Endpoint       string `json:"endpoint"`
	DoNotUseTLS    bool   `json:"doNotUseTLS,omitempty"`
	DoNotVerifyTLS bool   `json:"doNotVerifyTLS,omitempty"`

	AccessKeyID     string `json:"accessKeyID"`
	SecretAccessKey string `json:"secretAccessKey" kopia:"sensitive"`
	SessionToken    string `json:"sessionToken" kopia:"sensitive"`

	// Region is an optional region to pass in authorization header.
	Region string `json:"region,omitempty"`

	throttling.Limits

	// PointInTime specifies a view of the (versioned) store at that time
	PointInTime *time.Time `json:"pointInTime,omitempty"`
}

Options defines options for S3-based storage.

type PrefixAndStorageClass added in v0.9.0

type PrefixAndStorageClass struct {
	Prefix       blob.ID `json:"prefix"`
	StorageClass string  `json:"storageClass"`
}

PrefixAndStorageClass defines the storage class to use for a particular blob ID prefix.

type StorageConfig added in v0.9.0

type StorageConfig struct {
	BlobOptions []PrefixAndStorageClass `json:"blobOptions,omitempty"`
}

StorageConfig contains storage configuration optionally persisted in the storage itself.

func (*StorageConfig) Load added in v0.9.0

func (p *StorageConfig) Load(r io.Reader) error

Load loads the StorageConfig from the provided reader.

func (*StorageConfig) Save added in v0.9.0

func (p *StorageConfig) Save(w io.Writer) error

Save saves the parameters to the provided writer.

Jump to

Keyboard shortcuts

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