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 ¶ added in v0.8.7
type AddTorrentOptions struct { ID string Stopped bool StopAfterDownload bool StopAfterMetadata bool }
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 ¶ added in v0.4.0
AddTracker adds a new tracker to a torrent.
func (*Client) AnnounceTorrent ¶ added in v0.10.0
AnnounceTorrent forces the torrent to re-announce to trackers and DHT.
func (*Client) CleanDatabase ¶ added in v1.1.0
CleanDatabase removes invalid records in session database.
func (*Client) GetSessionStats ¶ added in v0.3.0
func (c *Client) GetSessionStats() (*rpctypes.SessionStats, error)
GetSessionStats returns statistics about the remote Session.
func (*Client) GetTorrent ¶ added in v0.16.0
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 ¶ added in v0.7.0
GetTorrentWebseeds returns the WebSeed sources of a torrent.
func (*Client) ListTorrents ¶
ListTorrents returns the list of torrents in remote Session.
func (*Client) MoveTorrent ¶ added in v0.15.0
MoveTorrent moves the torrent to another Session.
func (*Client) RemoveTorrent ¶
RemoveTorrent removes a torrent from remote Session and deletes its data.
func (*Client) ServerVersion ¶ added in v0.2.0
ServerVersion returns the Rain version on remote server.
func (*Client) SetTimeout ¶ added in v1.2.5
func (*Client) StartAllTorrents ¶ added in v0.4.0
StartAllTorrents starts all torrents in the Session.
func (*Client) StartTorrent ¶
StartTorrent starts the torrent.
func (*Client) StopAllTorrents ¶ added in v0.4.0
StopAllTorrents stops all the torrents in the session.
func (*Client) StopTorrent ¶
StopTorrent stops the torrent.
func (*Client) VerifyTorrent ¶ added in v0.10.0
VerifyTorrent stops the torrent and verifies all of the pieces on disk. After verification is done, the torrent stays in stopped state.