rclone: github.com/ncw/rclone/backend/tardigrade Index | Files

package tardigrade

import "github.com/ncw/rclone/backend/tardigrade"

Package tardigrade provides an interface to Tardigrade decentralized object storage.

Index

Package Files

fs.go object.go

func NewFs Uses

func NewFs(name, root string, m configmap.Mapper) (_ fs.Fs, err error)

NewFs creates a filesystem backed by Tardigrade.

type Fs Uses

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

Fs represents a remote to Tardigrade

func (*Fs) Features Uses

func (f *Fs) Features() *fs.Features

Features returns the optional features of this Fs

func (*Fs) Hashes Uses

func (f *Fs) Hashes() hash.Set

Hashes returns the supported hash types of the filesystem.

func (*Fs) List Uses

func (f *Fs) List(ctx context.Context, relative string) (entries fs.DirEntries, err error)

List the objects and directories in relative into entries. The entries can be returned in any order but should be for a complete directory.

relative should be "" to list the root, and should not have trailing slashes.

This should return fs.ErrDirNotFound if the directory isn't found.

func (*Fs) ListR Uses

func (f *Fs) ListR(ctx context.Context, relative string, callback fs.ListRCallback) (err error)

ListR lists the objects and directories of the Fs starting from dir recursively into out.

relative should be "" to start from the root, and should not have trailing slashes.

This should return ErrDirNotFound if the directory isn't found.

It should call callback for each tranche of entries read. These need not be returned in any particular order. If callback returns an error then the listing will stop immediately.

Don't implement this unless you have a more efficient way of listing recursively that doing a directory traversal.

func (*Fs) Mkdir Uses

func (f *Fs) Mkdir(ctx context.Context, relative string) (err error)

Mkdir makes the directory (container, bucket)

Shouldn't return an error if it already exists

func (*Fs) Name Uses

func (f *Fs) Name() string

Name of the remote (as passed into NewFs)

func (*Fs) NewObject Uses

func (f *Fs) NewObject(ctx context.Context, relative string) (_ fs.Object, err error)

NewObject finds the Object at relative. If it can't be found it returns the error ErrorObjectNotFound.

func (*Fs) Precision Uses

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

Precision of the ModTimes in this Fs

func (*Fs) Put Uses

func (f *Fs) Put(ctx context.Context, in io.Reader, src fs.ObjectInfo, options ...fs.OpenOption) (_ fs.Object, err error)

Put in to the remote path with the modTime given of the given size

When called from outside an Fs by rclone, src.Size() will always be >= 0. But for unknown-sized objects (indicated by src.Size() == -1), Put should either return an error or upload it properly (rather than e.g. calling panic).

May create the object even if it returns an error - if so will return the object and the error, otherwise will return nil and the error

func (*Fs) PutStream Uses

func (f *Fs) PutStream(ctx context.Context, in io.Reader, src fs.ObjectInfo, options ...fs.OpenOption) (_ fs.Object, err error)

PutStream uploads to the remote path with the modTime given of indeterminate size.

May create the object even if it returns an error - if so will return the object and the error, otherwise will return nil and the error.

func (*Fs) Rmdir Uses

func (f *Fs) Rmdir(ctx context.Context, relative string) (err error)

Rmdir removes the directory (container, bucket)

NOTE: Despite code documentation to the contrary, this method should not return an error if the directory does not exist.

func (*Fs) Root Uses

func (f *Fs) Root() string

Root of the remote (as passed into NewFs)

func (*Fs) String Uses

func (f *Fs) String() string

String returns a description of the FS

type Object Uses

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

Object describes a Tardigrade object

func (*Object) Fs Uses

func (o *Object) Fs() fs.Info

Fs returns read only access to the Fs that this object is part of

func (*Object) Hash Uses

func (o *Object) Hash(ctx context.Context, ty hash.Type) (_ string, err error)

Hash returns the selected checksum of the file If no checksum is available it returns ""

func (*Object) ModTime Uses

func (o *Object) ModTime(ctx context.Context) time.Time

ModTime returns the modification date of the file It should return a best guess if one isn't available

func (*Object) Open Uses

func (o *Object) Open(ctx context.Context, options ...fs.OpenOption) (_ io.ReadCloser, err error)

Open opens the file for read. Call Close() on the returned io.ReadCloser

func (*Object) Remote Uses

func (o *Object) Remote() string

Remote returns the remote path

func (*Object) Remove Uses

func (o *Object) Remove(ctx context.Context) (err error)

Remove this object.

func (*Object) SetModTime Uses

func (o *Object) SetModTime(ctx context.Context, t time.Time) (err error)

SetModTime sets the metadata on the object to set the modification date

func (*Object) Size Uses

func (o *Object) Size() int64

Size returns the size of the file

func (*Object) Storable Uses

func (o *Object) Storable() bool

Storable says whether this object can be stored

func (*Object) String Uses

func (o *Object) String() string

String returns a description of the Object

func (*Object) Update Uses

func (o *Object) Update(ctx context.Context, in io.Reader, src fs.ObjectInfo, options ...fs.OpenOption) (err error)

Update in to the object with the modTime given of the given size

When called from outside an Fs by rclone, src.Size() will always be >= 0. But for unknown-sized objects (indicated by src.Size() == -1), Upload should either return an error or update the object properly (rather than e.g. calling panic).

type Options Uses

type Options struct {
    Access string `config:"access_grant"`

    SatelliteAddress string `config:"satellite_address"`
    APIKey           string `config:"api_key"`
    Passphrase       string `config:"passphrase"`
}

Options defines the configuration for this backend

Package tardigrade imports 17 packages (graph). Updated 2020-06-28. Refresh now. Tools for package owners.