s3

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2022 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Backend

type Backend struct {
	// contains filtered or unexported fields
}

Backend implements storage.Backend for AWs S3.

func New

func New(l log.Logger, c Config, debug bool) (*Backend, error)

New creates an S3 backend.

func (*Backend) Exists

func (b *Backend) Exists(ctx context.Context, p string) (bool, error)

Exists checks if object already exists.

func (*Backend) Get

func (b *Backend) Get(ctx context.Context, p string, w io.Writer) error

Get writes downloaded content to the given writer.

func (*Backend) Put

func (b *Backend) Put(ctx context.Context, p string, r io.Reader) error

Put uploads contents of the given reader.

type Config

type Config struct {
	// Indicates the files ACL, which should be one,
	// of the following:
	//     private
	//     public-read
	//     public-read-write
	//     authenticated-read
	//     bucket-owner-read
	//     bucket-owner-full-control
	ACL         string
	Bucket      string
	Encryption  string // if not "", enables server-side encryption. valid values are: AES256, aws:kms.
	Endpoint    string
	Key         string
	StsEndpoint string
	RoleArn     string // if "", do not assume IAM role i.e. use the IAM user.

	// us-east-1
	// us-west-1
	// us-west-2
	// eu-west-1
	// ap-southeast-1
	// ap-southeast-2
	// ap-northeast-1
	// sa-east-1
	Region string
	Secret string

	PathStyle bool // Use path style instead of domain style. Should be true for minio and false for AWS.
	Public    bool
}

Config is a structure to store S3 backend configuration.

Jump to

Keyboard shortcuts

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