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

package fichier

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

Index

Package Files

api.go fichier.go object.go structs.go

func NewFs Uses

func NewFs(ctx context.Context, name string, root string, config configmap.Mapper) (fs.Fs, error)

NewFs makes a new Fs object from the path

The path is of the form remote:path

Remotes are looked up in the config file. If the remote isn't found then NotFoundInConfigFile will be returned.

On Windows avoid single character remote names as they can be mixed up with drive letters.

type DownloadRequest Uses

type DownloadRequest struct {
    URL    string `json:"url"`
    Single int    `json:"single"`
}

DownloadRequest is the request structure of the corresponding request

type EndFileUploadResponse Uses

type EndFileUploadResponse struct {
    Incoming int `json:"incoming"`
    Links    []struct {
        Download  string `json:"download"`
        Filename  string `json:"filename"`
        Remove    string `json:"remove"`
        Size      string `json:"size"`
        Whirlpool string `json:"whirlpool"`
    }   `json:"links"`
}

EndFileUploadResponse is the response structure of the corresponding request

type File Uses

type File struct {
    ACL         int    `json:"acl"`
    CDN         int    `json:"cdn"`
    Checksum    string `json:"checksum"`
    ContentType string `json:"content-type"`
    Date        string `json:"date"`
    Filename    string `json:"filename"`
    Pass        int    `json:"pass"`
    Size        int64  `json:"size"`
    URL         string `json:"url"`
}

File is the structure how 1Fichier returns a File

type FilesList Uses

type FilesList struct {
    Items  []File `json:"items"`
    Status string `json:"Status"`
}

FilesList is the structure how 1Fichier returns a list of files

type Folder Uses

type Folder struct {
    CreateDate string `json:"create_date"`
    ID         int    `json:"id"`
    Name       string `json:"name"`
    Pass       int    `json:"pass"`
}

Folder is the structure how 1Fichier returns a Folder

type FoldersList Uses

type FoldersList struct {
    FolderID   int      `json:"folder_id"`
    Name       string   `json:"name"`
    Status     string   `json:"Status"`
    SubFolders []Folder `json:"sub_folders"`
}

FoldersList is the structure how 1Fichier returns a list of Folders

type Fs Uses

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

Fs is the interface a cloud storage system must provide

func (*Fs) CreateDir Uses

func (f *Fs) CreateDir(ctx context.Context, pathID, leaf string) (newID string, err error)

CreateDir makes a directory with pathID as parent and name leaf

func (*Fs) Features Uses

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

Features returns the optional features of this Fs

func (*Fs) FindLeaf Uses

func (f *Fs) FindLeaf(ctx context.Context, pathID, leaf string) (pathIDOut string, found bool, err error)

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

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, 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 ErrDirNotFound if the directory isn't found.

func (*Fs) Mkdir Uses

func (f *Fs) Mkdir(ctx context.Context, dir string) 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, remote string) (fs.Object, error)

NewObject finds the Object at remote. 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, 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) PutUnchecked Uses

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

PutUnchecked uploads the object

This will create a duplicate if we upload a new file without checking to see if there is one already - use Put() for that.

func (*Fs) Rmdir Uses

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

Rmdir removes the directory (container, bucket) 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 returns a description of the FS

type GenericOKResponse Uses

type GenericOKResponse struct {
    Status  string `json:"status"`
    Message string `json:"message"`
}

GenericOKResponse is the response structure of the corresponding request

type GetTokenResponse Uses

type GetTokenResponse struct {
    URL     string `json:"url"`
    Status  string `json:"Status"`
    Message string `json:"Message"`
}

GetTokenResponse is the response structure of the corresponding request

type GetUploadNodeResponse Uses

type GetUploadNodeResponse struct {
    ID  string `json:"id"`
    URL string `json:"url"`
}

GetUploadNodeResponse is the response structure of the corresponding request

type ListFilesRequest Uses

type ListFilesRequest struct {
    FolderID int `json:"folder_id"`
}

ListFilesRequest is the request structure of the corresponding request

type ListFolderRequest Uses

type ListFolderRequest struct {
    FolderID int `json:"folder_id"`
}

ListFolderRequest is the request structure of the corresponding request

type MakeFolderRequest Uses

type MakeFolderRequest struct {
    Name     string `json:"name"`
    FolderID int    `json:"folder_id"`
}

MakeFolderRequest is the request structure of the corresponding request

type MakeFolderResponse Uses

type MakeFolderResponse struct {
    Name     string `json:"name"`
    FolderID int    `json:"folder_id"`
}

MakeFolderResponse is the response structure of the corresponding request

type Object Uses

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

Object is a filesystem like object provided by an Fs

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, t 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) MimeType Uses

func (o *Object) MimeType(ctx context.Context) string

MimeType of an Object if known, "" otherwise

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, 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) error

Remove removes this object

func (*Object) SetModTime Uses

func (o *Object) SetModTime(context.Context, 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 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) 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 {
    APIKey       string               `config:"api_key"`
    SharedFolder string               `config:"shared_folder"`
    Enc          encoder.MultiEncoder `config:"encoding"`
}

Options defines the configuration for this backend

type RemoveFileRequest Uses

type RemoveFileRequest struct {
    Files []RmFile `json:"files"`
}

RemoveFileRequest is the request structure of the corresponding request

type RemoveFolderRequest Uses

type RemoveFolderRequest struct {
    FolderID int `json:"folder_id"`
}

RemoveFolderRequest is the request structure of the corresponding request

type RmFile Uses

type RmFile struct {
    URL string `json:"url"`
}

RmFile is the request structure of the corresponding request

type SharedFile Uses

type SharedFile struct {
    Filename string `json:"filename"`
    Link     string `json:"link"`
    Size     int64  `json:"size"`
}

SharedFile is the structure how 1Fichier returns a shared File

type SharedFolderResponse Uses

type SharedFolderResponse []SharedFile

SharedFolderResponse is the response structure of the corresponding request

Package fichier imports 20 packages (graph). Updated 2020-11-26. Refresh now. Tools for package owners.