rtorrent-rpc-0.2.2.0: A library for communicating with RTorrent over its XML-RPC interface.

Copyright(c) Kai Lindholm, 2014
LicenseMIT
Maintainermegantti@gmail.com
Stabilityexperimental
Safe HaskellNone
LanguageHaskell2010

Network.RTorrent.CommandList

Contents

Description

A module for defined commands.

To combine multiple commands, use :*:, or store them in a list, as both of these types have Command instances.

Synopsis

Documentation

Functions for global variables

data Global t Source

Execute a command with a result type t.

Instances

Functor Global 
Command (Global a) 
type Ret (Global a) = a 

getUpRate :: Global Int Source

Get the current up rate, in bytes per second.

getDownRate :: Global Int Source

Get the current down rate, in bytes per second.

getDirectory :: Global String Source

Get the default download directory.

getPid :: Global Int Source

Get the process id.

getUploadRate :: Global Int Source

Get the maximum upload rate, in bytes per second.

0 means no limit.

getDownloadRate :: Global Int Source

Get the maximum download rate, in bytes per second.

0 means no limit.

setUploadRate :: Int -> Global Int Source

Set the maximum upload rate, in bytes per second.

setDownloadRate :: Int -> Global Int Source

Set the maximum download rate, in bytes per second.

Loading new torrents

loadTorrent Source

Arguments

:: String

A path / URL

-> Global Int 

Load a torrent file.

loadTorrentRaw Source

Arguments

:: ByteString

A torrent file as data

-> Global Int 

Load a torrent file.

loadStartTorrent Source

Arguments

:: String

A path / URL

-> Global Int 

Load a torrent file and start downloading it.

loadStartTorrentRaw Source

Arguments

:: ByteString

A torrent file as data

-> Global Int 

Load a torrent file and start downloading it.

Constructing new commands

commandSimple :: XmlRpcType a => String -> Global a Source

Run a command with no arguments.

commandArgs :: XmlRpcType a => String -> [Value] -> Global a Source

Run a command with the given arguments.

commandInt :: XmlRpcType a => String -> Int -> Global a Source

Run a command with the Int given as an argument.

commandString Source

Arguments

:: XmlRpcType a 
=> String

Command

-> String

Argument

-> Global a 

Run a command with the String given as an argument.

Re-exported from Network.RTorrent.Action

(<+>) :: (i -> Action i a) -> (i -> Action i b) -> i -> Action i (a :*: b) infixr 6 Source

Combine two actions to get a new one.

sequenceActions :: Traversable f => f (i -> Action i a) -> i -> Action i (f a) Source

Sequence multiple actions, for example with f = [].

Re-exported from Network.RTorrent.Command

data a :*: b infixr 6 Source

A strict 2-tuple for easy combining of commands.

Constructors

(:*:) !a !b infixr 6 

Instances

(Show a, Show b) => Show ((:*:) a b) 
(NFData a, NFData b) => NFData ((:*:) a b) 
(Command a, Command b) => Command ((:*:) a b) 
type Ret ((:*:) a b) = (:*:) (Ret a) (Ret b) 

data AnyCommand where Source

Existential wrapper for any command.

Commands wrapped in AnyCommand won't parse their results.

AnyCommand can be used when you want to call multiple commands but don't care about their return values.

Constructors

AnyCommand :: Command a => a -> AnyCommand 

class Command a Source

A typeclass for commands that can be send to RTorrent.

Minimal complete definition

commandCall, commandValue

Associated Types

type Ret a Source

Return type of the command.

Instances