s3

package
v0.0.0-...-36df34d Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2020 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LOCK_FILENAME = "remote_lock"
)
View Source
const (
	UNKNOWN_HOSTNAME = "unknown"
)

Variables

This section is empty.

Functions

func GetSize

func GetSize(bucket string, objectId string, s3Client *s3.S3) (int64, error)

Utility that just gets an object's size. Will require one fetch.

Types

type S3Connector

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

func NewS3Connector

func NewS3Connector(bucket string, credentialsPath string, awsProfile string, region string, endpoint string, force bool) (*S3Connector, error)

There should only ever be one connection to a filesystem at a time. If an old connection has not been properly closed, then the force parameter may be used to cleanup the old connection.

func (*S3Connector) Close

func (this *S3Connector) Close() error

func (*S3Connector) GetCipherReader

func (this *S3Connector) GetCipherReader(fileInfo *dirent.Dirent, blockCipher cipher.Block) (util.ReadSeekCloser, error)

func (*S3Connector) GetCipherWriter

func (this *S3Connector) GetCipherWriter(fileInfo *dirent.Dirent, blockCipher cipher.Block) (*cipherio.CipherWriter, error)

func (*S3Connector) GetId

func (this *S3Connector) GetId() string

func (*S3Connector) GetMetadataReader

func (this *S3Connector) GetMetadataReader(metadataId string, blockCipher cipher.Block, iv []byte) (util.ReadSeekCloser, error)

func (*S3Connector) GetMetadataWriter

func (this *S3Connector) GetMetadataWriter(metadataId string, blockCipher cipher.Block, iv []byte) (*cipherio.CipherWriter, error)

func (*S3Connector) PrepareStorage

func (this *S3Connector) PrepareStorage() error

Nothing necessary for S3.

func (*S3Connector) RemoveFile

func (this *S3Connector) RemoveFile(file *dirent.Dirent) error

func (*S3Connector) RemoveMetadataFile

func (this *S3Connector) RemoveMetadataFile(metadataId string) error

type S3Reader

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

func NewS3Reader

func NewS3Reader(bucket string, objectId string, s3Client *s3.S3, ciphertextSize int64) *S3Reader

func (*S3Reader) Close

func (this *S3Reader) Close() error

func (*S3Reader) Read

func (this *S3Reader) Read(outBuffer []byte) (int, error)

func (*S3Reader) Seek

func (this *S3Reader) Seek(offset int64, whence int) (int64, error)

type S3Writer

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

func NewS3Writer

func NewS3Writer(bucket string, objectId string, s3Client *s3.S3, isMetadata bool) (*S3Writer, error)

func (*S3Writer) Abort

func (this *S3Writer) Abort() error

func (*S3Writer) Close

func (this *S3Writer) Close() error

func (*S3Writer) Write

func (this *S3Writer) Write(data []byte) (int, error)

Jump to

Keyboard shortcuts

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