rclone

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2026 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

View Source
const CSI_ANNOTATION_PREFIX = "csi-rclone.dev"

Variables

View Source
var (
	DriverVersion = "SwissDataScienceCenter"
)
View Source
var (
	ErrVolumeNotFound = errors.New("volume is not found")
)

Functions

func NewControllerServer

func NewControllerServer(csiDriver *csicommon.CSIDriver) *controllerServer

func NewNodeServer

func NewNodeServer(csiDriver *csicommon.CSIDriver, cacheDir string, cacheSize string) (*nodeServer, error)

Types

type ConfigCreateRequest

type ConfigCreateRequest struct {
	Name        string                 `json:"name"`
	Parameters  map[string]string      `json:"parameters"`
	StorageType string                 `json:"type"`
	Opt         map[string]interface{} `json:"opt"`
}

type ConfigDeleteRequest

type ConfigDeleteRequest struct {
	Name string `json:"name"`
}

type Driver

type Driver struct {
	CSIDriver *csicommon.CSIDriver
	// contains filtered or unexported fields
}

func NewDriver

func NewDriver(nodeID, endpoint string) *Driver

func (*Driver) Run

func (d *Driver) Run() error

func (*Driver) Stop added in v0.3.0

func (d *Driver) Stop() error

func (*Driver) WithControllerServer added in v0.3.7

func (d *Driver) WithControllerServer(cs *controllerServer) *Driver

func (*Driver) WithNodeServer added in v0.3.7

func (d *Driver) WithNodeServer(ns *nodeServer) *Driver

type MountOpt

type MountOpt struct {
	DebugFUSE          bool     `json:",omitempty"`
	AllowNonEmpty      bool     `json:",omitempty"`
	AllowRoot          bool     `json:",omitempty"`
	AllowOther         bool     `json:",omitempty"`
	DefaultPermissions bool     `json:",omitempty"`
	WritebackCache     bool     `json:",omitempty"`
	DaemonWait         string   `json:",omitempty"` // time to wait for ready mount from daemon, maximum on Linux or constant on macOS/BSD
	MaxReadAhead       string   `json:",omitempty"`
	ExtraOptions       []string `json:",omitempty"`
	ExtraFlags         []string `json:",omitempty"`
	AttrTimeout        string   `json:",omitempty"` // how long the kernel caches attribute for
	DeviceName         string   `json:",omitempty"`
	VolumeName         string   `json:",omitempty"`
	NoAppleDouble      bool     `json:",omitempty"`
	NoAppleXattr       bool     `json:",omitempty"`
	AsyncRead          bool     `json:",omitempty"`
	CaseInsensitive    string   `json:",omitempty"`
}

Options for creating the mount

Note that options not supported on Linux have been removed.

type MountRequest

type MountRequest struct {
	Fs         string   `json:"fs"`
	MountPoint string   `json:"mountPoint"`
	VfsOpt     VfsOpt   `json:"vfsOpt"`
	MountOpt   MountOpt `json:"mountOpt"`
}

type Operations

type Operations interface {
	CreateVol(ctx context.Context, volumeName, remote, remotePath, rcloneConfigPath string, pameters map[string]string) error
	DeleteVol(ctx context.Context, rcloneVolume *RcloneVolume, rcloneConfigPath string, pameters map[string]string) error
	Mount(ctx context.Context, rcloneVolume *RcloneVolume, targetPath string, rcloneConfigData string, readOnly bool, pameters map[string]string) error
	Unmount(ctx context.Context, volumeId string, targetPath string) error
	GetVolumeById(ctx context.Context, volumeId string) (*RcloneVolume, error)
	Cleanup() error
	Run() error
}

func NewRclone

func NewRclone(kubeClient *kubernetes.Clientset, port int, cacheDir string, cacheSize string) Operations

type Rclone

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

func (*Rclone) Cleanup

func (r *Rclone) Cleanup() error

func (*Rclone) CreateVol

func (r *Rclone) CreateVol(ctx context.Context, volumeName, remote, remotePath, rcloneConfigPath string, parameters map[string]string) error

func (Rclone) DeleteVol

func (r Rclone) DeleteVol(ctx context.Context, rcloneVolume *RcloneVolume, rcloneConfigPath string, parameters map[string]string) error

func (Rclone) GetVolumeById

func (r Rclone) GetVolumeById(ctx context.Context, volumeId string) (*RcloneVolume, error)

func (*Rclone) Mount

func (r *Rclone) Mount(ctx context.Context, rcloneVolume *RcloneVolume, targetPath, rcloneConfigData string, readOnly bool, parameters map[string]string) error

func (*Rclone) Run added in v0.3.0

func (r *Rclone) Run() error

func (Rclone) Unmount

func (r Rclone) Unmount(ctx context.Context, volumeId string, targetPath string) error

type RcloneVolume

type RcloneVolume struct {
	Remote     string
	RemotePath string
	ID         string
}

type UnmountRequest

type UnmountRequest struct {
	MountPoint string `json:"mountPoint"`
}

type VfsOpt

type VfsOpt struct {
	NoSeek             bool        `json:",omitempty"` // don't allow seeking if set
	NoChecksum         bool        `json:",omitempty"` // don't check checksums if set
	ReadOnly           bool        `json:",omitempty"` // if set VFS is read only
	NoModTime          bool        `json:",omitempty"` // don't read mod times for files
	DirCacheTime       string      `json:",omitempty"` // how long to consider directory listing cache valid
	Refresh            bool        `json:",omitempty"` // refreshes the directory listing recursively on start
	PollInterval       string      `json:",omitempty"`
	Umask              int         `json:",omitempty"`
	UID                uint32      `json:",omitempty"`
	GID                uint32      `json:",omitempty"`
	DirPerms           os.FileMode `json:",omitempty"`
	FilePerms          os.FileMode `json:",omitempty"`
	ChunkSize          string      `json:",omitempty"` // if > 0 read files in chunks
	ChunkSizeLimit     string      `json:",omitempty"` // if > ChunkSize double the chunk size after each chunk until reached
	ChunkStreams       int         `json:",omitempty"`
	CacheMode          string      `json:",omitempty"`
	CacheMaxAge        string      `json:",omitempty"`
	CacheMaxSize       string      `json:",omitempty"`
	CacheMinFreeSpace  string      `json:",omitempty"`
	CachePollInterval  string      `json:",omitempty"`
	CaseInsensitive    bool        `json:",omitempty"`
	WriteWait          string      `json:",omitempty"` // time to wait for in-sequence write
	ReadWait           string      `json:",omitempty"` // time to wait for in-sequence read
	WriteBack          string      `json:",omitempty"` // time to wait before writing back dirty files
	ReadAhead          string      `json:",omitempty"` // bytes to read ahead in cache mode "full"
	UsedIsSize         bool        `json:",omitempty"` // if true, use the `rclone size` algorithm for Used size
	FastFingerprint    bool        `json:",omitempty"` // if set use fast fingerprints
	DiskSpaceTotalSize string      `json:",omitempty"`
}

VfsOpt is options for creating the vfs

Note that the `Daemon` option has been removed as it is not accepted for rc calls.

Jump to

Keyboard shortcuts

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