rclone: github.com/ncw/rclone/backend/seafile Index | Files | Directories

package seafile

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

Index

Package Files

object.go pacer.go seafile.go webapi.go

Constants

const (
    APIv20 = "api2/repos/"
    APIv21 = "api/v2.1/repos/"
)

Start of the API URLs

Variables

var (
    ErrorInternalDuringUpload = errors.New("Internal server error during file upload")
)

Errors specific to seafile fs

func Config Uses

func Config(name string, m configmap.Mapper)

Config callback for 2FA

func NewFs Uses

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

NewFs constructs an Fs from the path, container:path

type Fs Uses

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

Fs represents a remote seafile

func (*Fs) About Uses

func (f *Fs) About(ctx context.Context) (usage *fs.Usage, err error)

About gets quota information

func (*Fs) CleanUp Uses

func (f *Fs) CleanUp(ctx context.Context) error

CleanUp the trash in the Fs

func (*Fs) Copy Uses

func (f *Fs) Copy(ctx context.Context, 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

If it isn't possible then return fs.ErrorCantCopy

func (*Fs) DirMove Uses

func (f *Fs) DirMove(ctx context.Context, src fs.Fs, srcRemote, dstRemote string) error

DirMove moves src, srcRemote to this remote at dstRemote using server side move operations.

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

If it isn't possible then return fs.ErrorCantDirMove

If destination exists then return fs.ErrorDirExists

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 sets.

func (*Fs) List Uses

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

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

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

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

func (*Fs) ListR Uses

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

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

dir 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.

func (*Fs) Mkdir Uses

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

Mkdir makes the directory or library

Shouldn't return an error if it already exists

func (*Fs) Move Uses

func (f *Fs) Move(ctx context.Context, src fs.Object, remote string) (fs.Object, error)

Move src to this remote using server side move operations.

This is stored with the remote path given

It returns the destination Object and a possible error

If it isn't possible then return fs.ErrorCantMove

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, remote string) (fs.Object, error)

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

func (*Fs) Precision Uses

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

Precision of the ModTimes in this Fs

func (f *Fs) PublicLink(ctx context.Context, remote string, expire fs.Duration, unlink bool) (string, error)

PublicLink generates a public link to the remote path (usually readable by anyone)

func (*Fs) Purge Uses

func (f *Fs) Purge(ctx context.Context, dir string) error

Purge all files in the directory

Implement this if you have a way of deleting all the files quicker than just running Remove() on the result of List()

Return an error if it doesn't exist

func (*Fs) Put Uses

func (f *Fs) Put(ctx context.Context, in io.Reader, src fs.ObjectInfo, options ...fs.OpenOption) (fs.Object, 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, error)

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

func (*Fs) Rmdir Uses

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

Rmdir removes the directory or library if empty

Return an error if it doesn't exist or isn't empty

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 converts this Fs to a string

func (*Fs) UserInfo Uses

func (f *Fs) UserInfo(ctx context.Context) (map[string]string, error)

UserInfo returns info about the connected user

type Object Uses

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

Object describes a seafile object (also commonly called a file)

func (*Object) Fs Uses

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

Fs returns the parent Fs

func (*Object) Hash Uses

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

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

func (*Object) ID Uses

func (o *Object) ID() string

ID returns the ID of the Object if known, or "" if not

func (*Object) ModTime Uses

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

ModTime returns last modified time

func (*Object) Open Uses

func (o *Object) Open(ctx context.Context, options ...fs.OpenOption) (io.ReadCloser, 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 string

func (*Object) Remove Uses

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

Remove this object

func (*Object) SetModTime Uses

func (o *Object) SetModTime(ctx context.Context, t time.Time) 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 an object in bytes

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

Return a string version

func (*Object) Update Uses

func (o *Object) Update(ctx context.Context, in io.Reader, src fs.ObjectInfo, options ...fs.OpenOption) 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 {
    URL           string               `config:"url"`
    User          string               `config:"user"`
    Password      string               `config:"pass"`
    Is2FA         bool                 `config:"2fa"`
    AuthToken     string               `config:"auth_token"`
    LibraryName   string               `config:"library"`
    LibraryKey    string               `config:"library_key"`
    CreateLibrary bool                 `config:"create_library"`
    Enc           encoder.MultiEncoder `config:"encoding"`
}

Options defines the configuration for this backend

Directories

PathSynopsis
api

Package seafile imports 30 packages (graph). Updated 2020-09-21. Refresh now. Tools for package owners.