Documentation ¶
Overview ¶
Package rainrpc provides a RPC client implementation for communicating with Rain session.
Index ¶
- type AddTorrentOptions
- type Client
- func (c *Client) AddPeer(id string, addr string) error
- func (c *Client) AddTorrent(f io.Reader, options *AddTorrentOptions) (*rpctypes.Torrent, error)
- func (c *Client) AddTracker(id string, uri string) error
- func (c *Client) AddURI(uri string, options *AddTorrentOptions) (*rpctypes.Torrent, error)
- func (c *Client) Addr() string
- func (c *Client) AnnounceTorrent(id string) error
- func (c *Client) CleanDatabase() error
- func (c *Client) Close() error
- func (c *Client) GetMagnet(id string) (string, error)
- func (c *Client) GetSessionStats() (*rpctypes.SessionStats, error)
- func (c *Client) GetTorrent(id string) ([]byte, error)
- func (c *Client) GetTorrentPeers(id string) ([]rpctypes.Peer, error)
- func (c *Client) GetTorrentStats(id string) (*rpctypes.Stats, error)
- func (c *Client) GetTorrentTrackers(id string) ([]rpctypes.Tracker, error)
- func (c *Client) GetTorrentWebseeds(id string) ([]rpctypes.Webseed, error)
- func (c *Client) ListTorrents() ([]rpctypes.Torrent, error)
- func (c *Client) MoveTorrent(id, target string) error
- func (c *Client) RemoveTorrent(id string) error
- func (c *Client) ServerVersion() (string, error)
- func (c *Client) SetTimeout(d time.Duration)
- func (c *Client) StartAllTorrents() error
- func (c *Client) StartTorrent(id string) error
- func (c *Client) StopAllTorrents() error
- func (c *Client) StopTorrent(id string) error
- func (c *Client) VerifyTorrent(id string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AddTorrentOptions ¶
AddTorrentOptions contains optional parameters for adding a new Torrent.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a JSON-RPC 2.0 client for calling methods of a remote Session.
func (*Client) AddTorrent ¶
AddTorrent adds a new torrent by reading .torrent file.
func (*Client) AddTracker ¶
AddTracker adds a new tracker to a torrent.
func (*Client) AnnounceTorrent ¶
AnnounceTorrent forces the torrent to re-announce to trackers and DHT.
func (*Client) CleanDatabase ¶
CleanDatabase removes invalid records in session database.
func (*Client) GetSessionStats ¶
func (c *Client) GetSessionStats() (*rpctypes.SessionStats, error)
GetSessionStats returns statistics about the remote Session.
func (*Client) GetTorrent ¶
GetTorrent returns the bytes of a .torrent file.
func (*Client) GetTorrentPeers ¶
GetTorrentPeers returns the list of connected peers of a torrent.
func (*Client) GetTorrentStats ¶
GetTorrentStats returns statistics about a torrent.
func (*Client) GetTorrentTrackers ¶
GetTorrentTrackers returns the list of tracker in the torrent.
func (*Client) GetTorrentWebseeds ¶
GetTorrentWebseeds returns the WebSeed sources of a torrent.
func (*Client) ListTorrents ¶
ListTorrents returns the list of torrents in remote Session.
func (*Client) MoveTorrent ¶
MoveTorrent moves the torrent to another Session.
func (*Client) RemoveTorrent ¶
RemoveTorrent removes a torrent from remote Session and deletes its data.
func (*Client) ServerVersion ¶
ServerVersion returns the Rain version on remote server.
func (*Client) SetTimeout ¶
func (*Client) StartAllTorrents ¶
StartAllTorrents starts all torrents in the Session.
func (*Client) StartTorrent ¶
StartTorrent starts the torrent.
func (*Client) StopAllTorrents ¶
StopAllTorrents stops all the torrents in the session.
func (*Client) StopTorrent ¶
StopTorrent stops the torrent.
func (*Client) VerifyTorrent ¶
VerifyTorrent stops the torrent and verifies all of the pieces on disk. After verification is done, the torrent stays in stopped state.