rclone

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BatchOperation

func BatchOperation(
	name, desc, dstFs, dstRemote string, endpoints []string, items []ListItem,
)

BatchOperation starts a batch job on a list of items.

func Copy

func Copy(items []ListItem, dstFs, dstRemote string)

Copy copies a list of items to the destination remote and path.

func CreateMount

func CreateMount(mountData map[string]interface{}) error

CreateMount creates a mountpoint.

func Delete

func Delete(items []ListItem)

Delete deletes a list of items from the remote.

func GetDataSlice

func GetDataSlice(ctx context.Context, endpoint, key string) ([]string, error)

GetDataSlice runs a command and returns its output as a slice.

func GetListPath

func GetListPath(path, dir string, cdback bool) (string, string)

GetListPath returns the joined path with the provided directory, or if cdback is true, returns the path's directory.

func ListMountTypes

func ListMountTypes(ctx context.Context) ([]string, error)

ListMountTypes lists the mount types.

func ListRemotes

func ListRemotes(ctx context.Context) ([]string, error)

ListRemotes lists the configured remotes.

func Mkdir

func Mkdir(id, fs, remote, name string) error

Mkdir creates a directory within the remote.

func Move

func Move(items []ListItem, dstFs, dstRemote string)

Move moves a list of items to the destination remote and path.

func PublicLink(id, fs, remote string, item ListItem) (string, error)

PublicLink returns a public link for the provided item.

func Unmount

func Unmount(mountpoint string) error

Unmount unmounts the provided mountpoint.

func UnmountAll

func UnmountAll() error

UnmountAll unmounts all mountpoints.

Types

type About

type About struct {
	Total   int64 `json:"total"`
	Used    int64 `json:"used"`
	Trashed int64 `json:"trashed"`
	Other   int64 `json:"other"`
	Free    int64 `json:"free"`
}

About stores the storage information for a remote.

func AboutFS

func AboutFS(ctx context.Context, fs string) (About, error)

AboutFS returns the storage information for a remote.

type FsDetail added in v0.0.3

type FsDetail struct {
	Name      string          `json:"Name"`
	Precision int             `json:"Precision"`
	Root      string          `json:"Root"`
	String    string          `json:"String"`
	Hashes    []string        `json:"Hashes"`
	Features  map[string]bool `json:"Features"`

	FeatureList []string
}

FsDetail stores details of a remote.

func FsInfo added in v0.0.3

func FsInfo(id, fs string) (FsDetail, error)

FsInfo returns information about a remote.

type List

type List struct {
	Items []ListItem `mapstructure:"list"`

	Path string
}

List stores a list of directory entries.

func ListFS

func ListFS(id, fstype, path string) (List, error)

ListFS returns a list of directory entries from the provided remote and path.

type ListItem

type ListItem struct {
	ID       string `mapstructure:"ID"`
	IsDir    bool   `mapstructure:"IsDir"`
	MimeType string `mapstructure:"MimeType"`
	ModTime  string `mapstructure:"ModTime"`
	Name     string `mapstructure:"Name"`
	Path     string `mapstructure:"Path"`
	Size     int64  `mapstructure:"Size"`

	FS               string
	ISize            string
	ModifiedTime     string
	ModifiedTimeUnix int64

	About          bool
	RefreshAddItem bool
}

ListItem stores information about a directory entry.

type MountHelp

type MountHelp struct {
	Name, Help, OptionType, ValueType string
	Windows, OSX, Other               bool

	Options []string
}

MountHelp stores information about a mount option.

func GetMountHelp

func GetMountHelp(name string) MountHelp

GetMountHelp returns the information for a mount option.

func GetMountOptions

func GetMountOptions() ([]MountHelp, error)

GetMountOptions returns a list of all mount options.

type MountPoint

type MountPoint struct {
	Fs         string    `json:"Fs"`
	MountPoint string    `json:"MountPoint"`
	MountedOn  time.Time `json:"MountedOn"`
}

MountPoint stores information about a mountpoint.

func GetMountPoints

func GetMountPoints() ([]MountPoint, error)

GetMountPoints returns a list of mountpoints.

type Mounts

type Mounts struct {
	MountPoints []MountPoint `json:"mountPoints"`
}

Mounts stores the list of mountpoints.

Jump to

Keyboard shortcuts

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