amazonclouddrive

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: 16 Imported by: 0

Documentation

Overview

Amazon Cloud Drive interface

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFs

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

NewFs constructs an FsAcd from the path, container:path

Types

type FsAcd

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

FsAcd represents a remote acd server

func (*FsAcd) CreateDir

func (f *FsAcd) CreateDir(pathId, leaf string) (newId string, err error)

CreateDir makes a directory with pathId as parent and name leaf

func (*FsAcd) FindLeaf

func (f *FsAcd) FindLeaf(pathId, leaf string) (pathIdOut string, found bool, err error)

FindLeaf finds a directory of name leaf in the folder with ID pathId

func (*FsAcd) List

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

Walk the path returning a channel of FsObjects

func (*FsAcd) ListDir

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

Lists the containers

func (*FsAcd) Mkdir

func (f *FsAcd) Mkdir() error

Mkdir creates the container if it doesn't exist

func (*FsAcd) Name

func (f *FsAcd) Name() string

The name of the remote (as passed into NewFs)

func (*FsAcd) NewFsObject

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

Return an FsObject from a path

May return nil if an error occurred

func (*FsAcd) Precision

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

Return the precision

func (*FsAcd) Purge

func (f *FsAcd) Purge() error

Purge deletes all the files and the container

Optional interface: Only implement this if you have a way of deleting all the files quicker than just running Remove() on the result of List()

func (*FsAcd) Put

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

Put the object into the container

Copy the reader in to the new object which is returned

The new object may have been created if an error is returned

func (*FsAcd) Rmdir

func (f *FsAcd) Rmdir() error

Rmdir deletes the root folder

Returns an error if it isn't empty

func (*FsAcd) Root

func (f *FsAcd) Root() string

The root of the remote (as passed into NewFs)

func (*FsAcd) String

func (f *FsAcd) String() string

String converts this FsAcd to a string

type FsObjectAcd

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

FsObjectAcd describes a acd object

Will definitely have info but maybe not meta

func (*FsObjectAcd) Fs

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

Return the parent Fs

func (*FsObjectAcd) Md5sum

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

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

func (*FsObjectAcd) ModTime

func (o *FsObjectAcd) 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 (*FsObjectAcd) Open

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

Open an object for read

func (*FsObjectAcd) Remote

func (o *FsObjectAcd) Remote() string

Return the remote path

func (*FsObjectAcd) Remove

func (o *FsObjectAcd) Remove() error

Remove an object

func (*FsObjectAcd) SetModTime

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

Sets the modification time of the local fs object

func (*FsObjectAcd) Size

func (o *FsObjectAcd) Size() int64

Size returns the size of an object in bytes

func (*FsObjectAcd) Storable

func (o *FsObjectAcd) Storable() bool

Is this object storable

func (*FsObjectAcd) String

func (o *FsObjectAcd) String() string

Return a string version

func (*FsObjectAcd) Update

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

Update the object with the contents of the io.Reader, modTime and size

The new object may have been created if an error is returned

Jump to

Keyboard shortcuts

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