queue

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2016 License: GPL-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Rtorrent struct {
		Addr         string `json:"addr" yaml:"addr"`
		InsecureCert bool   `json:"insecure_cert" yaml:"insecure_cert"`
		Username     string `json:"username" yaml:"username"`
		Password     string `json:"password" yaml:"password"`
	} `json:"rtorrent" yaml:"rtorrent,flow"`

	SSH struct {
		Username string        `json:"username" yaml:"username"`
		Password string        `json:"password" yaml:"password"`
		KeyPath  string        `json:"privkey_path" yaml:"privkey_path"`
		Addr     string        `json:"addr" yaml:"addr"`
		Timeout  time.Duration `json:"connect_timeout" yaml:"connect_timeout"`
	} `json:"ssh" yaml:"ssh,flow"`

	DownloadFileMode          os.FileMode       `json:"file_download_filemode" yaml:"file_download_filemode"`
	WatchDownloadPaths        map[string]string `json:"watch_to_download_paths" yaml:"watch_to_download_paths,flow"`
	TempDownloadPath          string            `json:"temp_download_path" yaml:"temp_download_path"`
	FinishedTorrentFilePath   map[string]string `json:"watch_to_finish_path" yaml:"watch_to_finish_path,flow"`
	RPCSocketPath             string            `json:"rpc_socket_path" yaml:"rpc_socket_path"`
	TorrentListUpdateInterval time.Duration     `json:"rtorrent_update_interval" yaml:"rtorrent_update_interval"`
	ConcurrentDownloads       uint              `json:"download_jobs" yaml:"download_jobs"`
	ResumeDownloads           bool              `json:"resume_downloads" yaml:"resume_downloads"`
	CheckDiskSpace            bool              `json:"check_disk_space" yaml:"check_disk_space"`
	MinDiskSpace              uint64            `json:"min_disk_space" yaml:"min_disk_space"`
}

Config defines the settings for watching, uploading, and downloading

type Queue

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

Queue watches the given folders for new .torrent files, uploads them to the given rTorrent server, and then downloads them over SSH to the given download path.

func NewQueue

func NewQueue(config *Config, logger *log.Logger) (*Queue, error)

NewQueue establishes all connections and watchers

func (*Queue) Close

func (q *Queue) Close() []error

Close all of the connections and watchers

func (*Queue) Run

func (q *Queue) Run(stop <-chan bool)

Run executes all steps needed for looking at the queue, catching updates, and processing all work

type RPCArgs added in v0.1.2

type RPCArgs struct{}

RPCArgs arg information for the RPC server

type RPCReq added in v0.1.2

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

RPCReq contains information for communicating with the RPC server

type RPCResponse added in v0.1.2

type RPCResponse string

RPCResponse holds the response

type Status added in v0.1.2

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

Status contains RPC request information

func (*Status) Downloads added in v0.1.2

func (s *Status) Downloads(_ RPCArgs, reply *RPCResponse) error

Downloads gets download statuses

Jump to

Keyboard shortcuts

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