s3lib

package module
v0.0.0-...-f71d02b Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type S3File

type S3File struct {
	Key          string
	LastModified time.Time
	Size         int64
	StorageClass string
}

type S3Lib

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

func NewS3Cli

func NewS3Cli(accessKey, secretKey, endpoint, region string, forcePathStyle bool) *S3Lib

func (*S3Lib) Delete

func (s *S3Lib) Delete(bucket, path string) (err error)

Delete deletes an item from an s3 bucket if the object does not exists, returns no error

func (*S3Lib) Download

func (s *S3Lib) Download(filename string, bucket, path string) (err error)

Download downloads an item from an s3 bucket and write it to the given file

func (*S3Lib) DownloadWriter

func (s *S3Lib) DownloadWriter(w io.WriterAt, bucket, path string) (err error)

Download downloads an item from an s3 bucket and write it to the given writer

func (*S3Lib) IsExpired

func (s *S3Lib) IsExpired() bool

Provider Interface

func (*S3Lib) List

func (s *S3Lib) List(bucket, path string) (files []S3File, err error)

List lists items in an s3 bucket given by a prefix. An empty prefix will list all the items

func (*S3Lib) Retrieve

func (s *S3Lib) Retrieve() (credentials.Value, error)

Provider Interface

func (*S3Lib) Upload

func (s *S3Lib) Upload(filename string, bucket, path string) (err error)

Upload uploads a file to the s3 bucket

func (*S3Lib) UploadReader

func (s *S3Lib) UploadReader(r io.Reader, bucket, path string) (err error)

UploadReader uploads the content of the Reader to the s3 bucket

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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