storage_s3

package
v0.0.0-...-483e9f6 Latest Latest
Warning

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

Go to latest
Published: May 3, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type S3

type S3 struct {
	storage.Storage
	// contains filtered or unexported fields
}

S3 is an implementation of the Storage interface for S3.

func FromFlags

func FromFlags(ctx *cli.Context) (*S3, error)

func New

func New(bucket string) (*S3, error)

New creates a new S3 storage backend. Supports AWS CLI related environment variables.

func (*S3) CanReadURI

func (s *S3) CanReadURI(uri string) (bool, error)

CanReadURI checks if a URI can be read by the storage backend.

func (*S3) Delete

func (s *S3) Delete(object string) error

Delete deletes a file from the storage backend.

func (*S3) Download

func (s *S3) Download(object string, toPath string) error

Download downloads a file from the storage backend to the given path.

func (*S3) Exists

func (s *S3) Exists(object string) (bool, error)

Exists checks if a file exists in the storage backend.

func (*S3) Get

func (s *S3) Get(object string) ([]byte, error)

Get returns the contents of a file from the storage backend.

func (*S3) Put

func (s *S3) Put(object string, fromPath string) (*storage.UploadInfo, error)

Put uploads a file to the storage backend.

func (*S3) PutBytes

func (s *S3) PutBytes(object string, data []byte) (*storage.UploadInfo, error)

PutBytes uploads a file to the storage backend.

Jump to

Keyboard shortcuts

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