rclone

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2023 License: BSD-2-Clause Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFactory

func NewFactory() location.Factory

Types

type Addr

type Addr struct{}

Addr implements net.Addr for stdin/stdout.

func (Addr) Network

func (a Addr) Network() string

Network returns the network type as a string.

func (Addr) String

func (a Addr) String() string

type Backend

type Backend struct {
	*rest.Backend
	// contains filtered or unexported fields
}

Backend is used to access data stored somewhere via rclone.

func Create

func Create(ctx context.Context, cfg Config, lim limiter.Limiter) (*Backend, error)

Create initializes a new restic repo with rclone.

func Open

func Open(ctx context.Context, cfg Config, lim limiter.Limiter) (*Backend, error)

Open starts an rclone process with the given config.

func (*Backend) Close

func (be *Backend) Close() error

Close terminates the backend.

type Config

type Config struct {
	Program     string `option:"program" help:"path to rclone (default: rclone)"`
	Args        string `option:"args"    help:"arguments for running rclone (default: serve restic --stdio --b2-hard-delete)"`
	Remote      string
	Connections uint          `option:"connections" help:"set a limit for the number of concurrent connections (default: 5)"`
	Timeout     time.Duration `option:"timeout"     help:"set a timeout limit to wait for rclone to establish a connection (default: 1m)"`
}

Config contains all configuration necessary to start rclone.

func NewConfig

func NewConfig() Config

NewConfig returns a new Config with the default values filled in.

func ParseConfig

func ParseConfig(s string) (*Config, error)

ParseConfig parses the string s and extracts the remote server URL.

type StdioConn

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

StdioConn implements a net.Conn via stdin/stdout.

func (*StdioConn) Close

func (s *StdioConn) Close() (err error)

Close closes the stream to the child process.

func (*StdioConn) CloseAll

func (s *StdioConn) CloseAll() (err error)

CloseAll closes both streams.

func (*StdioConn) LocalAddr

func (s *StdioConn) LocalAddr() net.Addr

LocalAddr returns nil.

func (*StdioConn) Read

func (s *StdioConn) Read(p []byte) (int, error)

func (*StdioConn) RemoteAddr

func (s *StdioConn) RemoteAddr() net.Addr

RemoteAddr returns nil.

func (*StdioConn) SetDeadline

func (s *StdioConn) SetDeadline(t time.Time) error

SetDeadline sets the read/write deadline.

func (*StdioConn) SetReadDeadline

func (s *StdioConn) SetReadDeadline(t time.Time) error

SetReadDeadline sets the read/write deadline.

func (*StdioConn) SetWriteDeadline

func (s *StdioConn) SetWriteDeadline(t time.Time) error

SetWriteDeadline sets the read/write deadline.

func (*StdioConn) Write

func (s *StdioConn) Write(p []byte) (int, error)

Jump to

Keyboard shortcuts

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