rclone

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2024 License: Apache-2.0 Imports: 29 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(d *Driver) *controllerServer

func NewNodeServer

func NewNodeServer(d *Driver) *nodeServer

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 {
	RcloneOps Operations
	Server    csicommon.NonBlockingGRPCServer
	// contains filtered or unexported fields
}

func NewDriver

func NewDriver(nodeID, endpoint string, kubeClient *kubernetes.Clientset) *Driver

func (*Driver) Run

func (d *Driver) Run() error

func (*Driver) Stop added in v0.3.0

func (d *Driver) Stop() error

type MountOpt

type MountOpt struct {
	AllowNonEmpty bool `json:"allowNonEmpty"`
	AllowOther    bool `json:"allowOther"`
}

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) 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 {
	CacheMode    string        `json:"cacheMode"`
	DirCacheTime time.Duration `json:"dirCacheTime"`
	ReadOnly     bool          `json:"readOnly"`
}

Jump to

Keyboard shortcuts

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