Copyright | (c) Kai Lindholm, 2014 |
---|---|
License | MIT |
Maintainer | megantti@gmail.com |
Stability | experimental |
Safe Haskell | None |
Language | Haskell2010 |
- module Network.RTorrent.File
- module Network.RTorrent.Peer
- module Network.RTorrent.Priority
- module Network.RTorrent.Torrent
- module Network.RTorrent.Tracker
- data Global t
- getUpRate :: Global Int
- getDownRate :: Global Int
- getDirectory :: Global String
- getPid :: Global Int
- getUploadRate :: Global Int
- getDownloadRate :: Global Int
- setUploadRate :: Int -> Global Int
- setDownloadRate :: Int -> Global Int
- loadTorrent :: String -> Global Int
- loadTorrentRaw :: ByteString -> Global Int
- loadStartTorrent :: String -> Global Int
- loadStartTorrentRaw :: ByteString -> Global Int
- commandSimple :: XmlRpcType a => String -> Global a
- commandArgs :: XmlRpcType a => String -> [Value] -> Global a
- commandInt :: XmlRpcType a => String -> Int -> Global a
- commandString :: XmlRpcType a => String -> String -> Global a
- (<+>) :: (i -> Action i a) -> (i -> Action i b) -> i -> Action i (a :*: b)
- sequenceActions :: Traversable f => f (i -> Action i a) -> i -> Action i (f a)
- data a :*: b = (:*:) !a !b
- data AnyCommand where
- AnyCommand :: Command a => a -> AnyCommand
- class Command a where
- type Ret a
Documentation
module Network.RTorrent.File
module Network.RTorrent.Peer
module Network.RTorrent.Priority
module Network.RTorrent.Torrent
module Network.RTorrent.Tracker
Functions for global variables
Execute a command with a result type t
.
getDownRate :: Global Int Source
Get the current down rate, in bytes per second.
getDirectory :: Global String Source
Get the default download directory.
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
Load a torrent file and start downloading it.
:: 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.
:: 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
A strict 2-tuple for easy combining of commands.
(:*:) !a !b infixr 6 |
data AnyCommand where Source
Existential wrapper for any command.
Command
s 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.
AnyCommand :: Command a => a -> AnyCommand |
Command AnyCommand | |
type Ret AnyCommand = Value |
A typeclass for commands that can be send to RTorrent.