s3

package
v0.0.0-...-e391311 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2015 License: MIT Imports: 21 Imported by: 0

Documentation

Overview

S3 interface

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFs

func NewFs(name, root string) (fs.Fs, error)

NewFsS3 contstructs an FsS3 from the path, bucket:path

Types

type FsObjectS3

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

FsObjectS3 describes a s3 object

func (*FsObjectS3) Fs

func (o *FsObjectS3) Fs() fs.Fs

Return the parent Fs

func (*FsObjectS3) Md5sum

func (o *FsObjectS3) Md5sum() (string, error)

Md5sum returns the Md5sum of an object returning a lowercase hex string

func (*FsObjectS3) ModTime

func (o *FsObjectS3) ModTime() time.Time

ModTime returns the modification time of the object

It attempts to read the objects mtime and if that isn't present the LastModified returned in the http headers

func (*FsObjectS3) Open

func (o *FsObjectS3) Open() (in io.ReadCloser, err error)

Open an object for read

func (*FsObjectS3) Remote

func (o *FsObjectS3) Remote() string

Return the remote path

func (*FsObjectS3) Remove

func (o *FsObjectS3) Remove() error

Remove an object

func (*FsObjectS3) SetModTime

func (o *FsObjectS3) SetModTime(modTime time.Time)

Sets the modification time of the local fs object

func (*FsObjectS3) Size

func (o *FsObjectS3) Size() int64

Size returns the size of an object in bytes

func (*FsObjectS3) Storable

func (o *FsObjectS3) Storable() bool

Is this object storable

func (*FsObjectS3) String

func (o *FsObjectS3) String() string

Return a string version

func (*FsObjectS3) Update

func (o *FsObjectS3) Update(in io.Reader, modTime time.Time, size int64) error

Update the Object from in with modTime and size

type FsS3

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

FsS3 represents a remote s3 server

func (*FsS3) Copy

func (f *FsS3) Copy(src fs.Object, remote string) (fs.Object, error)

Copy src to this remote using server side copy operations.

This is stored with the remote path given

It returns the destination Object and a possible error

Will only be called if src.Fs().Name() == f.Name()

If it isn't possible then return fs.ErrorCantCopy

func (*FsS3) List

func (f *FsS3) List() fs.ObjectsChan

Walk the path returning a channel of FsObjects

func (*FsS3) ListDir

func (f *FsS3) ListDir() fs.DirChan

Lists the buckets

func (*FsS3) Mkdir

func (f *FsS3) Mkdir() error

Mkdir creates the bucket if it doesn't exist

func (*FsS3) Name

func (f *FsS3) Name() string

The name of the remote (as passed into NewFs)

func (*FsS3) NewFsObject

func (f *FsS3) NewFsObject(remote string) fs.Object

Return an FsObject from a path

May return nil if an error occurred

func (*FsS3) Precision

func (f *FsS3) Precision() time.Duration

Return the precision

func (*FsS3) Put

func (f *FsS3) Put(in io.Reader, remote string, modTime time.Time, size int64) (fs.Object, error)

Put the FsObject into the bucket

func (*FsS3) Rmdir

func (f *FsS3) Rmdir() error

Rmdir deletes the bucket

Returns an error if it isn't empty

func (*FsS3) Root

func (f *FsS3) Root() string

The root of the remote (as passed into NewFs)

func (*FsS3) String

func (f *FsS3) String() string

String converts this FsS3 to a string

Jump to

Keyboard shortcuts

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