s3

package
v1.2.0 Latest Latest
Warning

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

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

Documentation

Overview

Package s3 this package in intention to hide aws s3 storage implementation under the interface that will give you the ability to user other cloud providers in the future

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileInfo

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

FileInfo struct to get file information

func (FileInfo) AcceptRanges added in v1.1.9

func (fi FileInfo) AcceptRanges() string

AcceptRanges get accept-ranges

func (FileInfo) ActiveStatus added in v1.1.9

func (fi FileInfo) ActiveStatus() string

ActiveStatus get ActiveStatus

func (FileInfo) BucketKeyEnabled added in v1.1.9

func (fi FileInfo) BucketKeyEnabled() bool

BucketKeyEnabled get BucketKeyEnabled

func (FileInfo) CacheControl added in v1.1.9

func (fi FileInfo) CacheControl() string

CacheControl get Cache-Control

func (FileInfo) ContentDisposition added in v1.1.9

func (fi FileInfo) ContentDisposition() string

ContentDisposition get Content-Disposition

func (FileInfo) ContentEncoding added in v1.1.9

func (fi FileInfo) ContentEncoding() string

ContentEncoding get Content-Encoding

func (FileInfo) ContentLanguage added in v1.1.9

func (fi FileInfo) ContentLanguage() string

ContentLanguage get Content-Language

func (FileInfo) ContentType added in v1.1.9

func (fi FileInfo) ContentType() string

ContentType get Content-Type

func (FileInfo) DeleteMarker added in v1.1.9

func (fi FileInfo) DeleteMarker() bool

DeleteMarker get DeleteMarker

func (FileInfo) ETag added in v1.1.9

func (fi FileInfo) ETag() string

ETag get ETag

func (FileInfo) Expiration added in v1.1.9

func (fi FileInfo) Expiration() string

Expiration get Expiration

func (FileInfo) Expires added in v1.1.9

func (fi FileInfo) Expires() string

Expires get Expires

func (FileInfo) LastModified added in v1.1.9

func (fi FileInfo) LastModified() time.Time

LastModified get Last-Modified

func (FileInfo) Metadata added in v1.1.9

func (fi FileInfo) Metadata() map[string]*string

Metadata get Metadata

func (FileInfo) MissingMeta added in v1.1.9

func (fi FileInfo) MissingMeta() int64

MissingMeta get MissingMeta

func (FileInfo) ObjectLockLegalHoldStatus added in v1.1.9

func (fi FileInfo) ObjectLockLegalHoldStatus() string

ObjectLockLegalHoldStatus get ObjectLockLegalHoldStatus

func (FileInfo) ObjectLockMode added in v1.1.9

func (fi FileInfo) ObjectLockMode() string

ObjectLockMode get ObjectLockMode

func (FileInfo) ObjectLockRetainUntilDate added in v1.1.9

func (fi FileInfo) ObjectLockRetainUntilDate() time.Time

ObjectLockRetainUntilDate get ObjectLockRetainUntilDate

func (FileInfo) PartsCount added in v1.1.9

func (fi FileInfo) PartsCount() int64

PartsCount get PartsCount

func (FileInfo) ReplicationStatus added in v1.1.9

func (fi FileInfo) ReplicationStatus() string

ReplicationStatus get ReplicationStatus

func (FileInfo) RequestCharged added in v1.1.9

func (fi FileInfo) RequestCharged() string

RequestCharged get RequestCharged

func (FileInfo) Restore added in v1.1.9

func (fi FileInfo) Restore() string

Restore get Restore

func (FileInfo) SSECustomerAlgorithm added in v1.1.9

func (fi FileInfo) SSECustomerAlgorithm() string

SSECustomerAlgorithm get SSECustomerAlgorithm

func (FileInfo) SSECustomerKeyMD5 added in v1.1.9

func (fi FileInfo) SSECustomerKeyMD5() string

SSECustomerKeyMD5 get SSECustomerKeyMD5

func (FileInfo) SSEKMSKeyId added in v1.1.9

func (fi FileInfo) SSEKMSKeyId() string

SSEKMSKeyId get SSEKMSKeyId

func (FileInfo) ServerSideEncryption added in v1.1.9

func (fi FileInfo) ServerSideEncryption() string

ServerSideEncryption get ServerSideEncryption

func (FileInfo) Size

func (fi FileInfo) Size() int64

Size get file size

func (FileInfo) StorageClass added in v1.1.9

func (fi FileInfo) StorageClass() string

StorageClass get StorageClass

func (FileInfo) VersionId added in v1.1.9

func (fi FileInfo) VersionId() string

VersionId get VersionId

func (FileInfo) WebsiteRedirectLocation added in v1.1.9

func (fi FileInfo) WebsiteRedirectLocation() string

WebsiteRedirectLocation get WebsiteRedirectLocation

type Storage

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

Storage interface adaptation for s3

func NewStorage

func NewStorage(ses *session.Session, bucket string) *Storage

NewStorage create new storage instance

func (*Storage) Copy added in v1.1.8

func (s *Storage) Copy(src string, dst string, options ...map[string]interface{}) error

Copy copies an object from the a path in a bucket to another path in the same or different bucket. 'src' and 'dst' are absolute paths of the file.

func (*Storage) CopyWithContext added in v1.1.8

func (s *Storage) CopyWithContext(ctx aws.Context, src string, dst string, options ...map[string]interface{}) error

CopyWithContext copies an object from the a path in a bucket to another path in the same or different bucket. 'src' and 'dst' are absolute paths of the file.

func (*Storage) Create

func (s *Storage) Create(_ string) (io.ReadWriteCloser, error)

Create for create interface

func (*Storage) Delete

func (s *Storage) Delete(path string) error

Delete remove object from s3

func (*Storage) DeleteWithContext added in v1.1.6

func (s *Storage) DeleteWithContext(ctx aws.Context, path string) error

DeleteWithContext removes object from s3

func (*Storage) Get

func (s *Storage) Get(path string) (io.ReadCloser, error)

Get file from s3 bucket

func (*Storage) GetWithContext added in v1.1.6

func (s *Storage) GetWithContext(ctx aws.Context, path string) (io.ReadCloser, error)

GetWithContext gets file from s3 bucket

func (s *Storage) Link(path string, expire time.Duration) (string, error)

Link generate expiration link for s3 access

func (*Storage) List added in v1.1.4

func (s *Storage) List(path string, options ...map[string]interface{}) ([]string, error)

List reads the path content or prefixes.

func (*Storage) ListWithContext added in v1.1.6

func (s *Storage) ListWithContext(ctx aws.Context, path string, options ...map[string]interface{}) ([]string, error)

ListWithContext reads the path content or prefixes

func (*Storage) Put

func (s *Storage) Put(path string, body io.Reader) error

Put file into s3 bucket

func (*Storage) PutWithContext added in v1.1.6

func (s *Storage) PutWithContext(ctx aws.Context, path string, body io.Reader) error

PutWithContext puts file into s3 bucket

func (*Storage) Stat

func (s *Storage) Stat(path string) (storage.FileInfo, error)

Stat get object info

func (*Storage) Walk

func (s *Storage) Walk(path string, callback func(path string)) error

Walk recursively look for files in directory

func (*Storage) WalkWithContext added in v1.1.6

func (s *Storage) WalkWithContext(ctx aws.Context, path string, callback func(path string)) error

WalkWithContext recursively look for files in directory

Jump to

Keyboard shortcuts

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