Documentation ¶
Overview ¶
- go-libdeluge v0.2.0 - a native deluge RPC client library
- Copyright (C) 2015~2017 gdm85 - https://github.com/gdm85/go-libdeluge/
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
Index ¶
- Constants
- Variables
- type Client
- func (c *Client) AddTorrentFile(fileName, fileContentBase64 string, options Options) (string, error)
- func (c *Client) AddTorrentMagnet(magnetURI string, options Options) (string, error)
- func (c *Client) AddTorrentURL(url string, options Options) (string, error)
- func (c *Client) Close() error
- func (c *Client) Connect() error
- func (c *Client) DaemonVersion() (string, error)
- func (c *Client) DeleteTorrent(id string) (bool, error)
- func (c *Client) GetFreeSpace(path string) (int64, error)
- func (c *Client) MethodsList() ([]string, error)
- func (c *Client) MoveStorage(torrentIDs []string, dest string) error
- func (c *Client) SessionState() ([]string, error)
- func (c *Client) TorrentsStatus() (map[string]*TorrentStatus, error)
- type DelugeClient
- type DelugeResponse
- type File
- type NativeDelugeClient
- type Options
- type Peer
- type RPCError
- type SerialMismatchError
- type Settings
- type TorrentStatus
Constants ¶
const (
DefaultReadWriteTimeout = time.Second * 30
)
Variables ¶
var ( // ErrAlreadyClosed is returned when connection is already closed. ErrAlreadyClosed = errors.New("connection is already closed") ErrInvalidListResult = errors.New("expected dictionary as list response") ErrInvalidReturnValue = errors.New("invalid return value") )
var STATUS_KEYS = rencode.NewList(
"state",
"download_location",
"tracker_host",
"tracker_status",
"next_announce",
"name",
"total_size",
"progress",
"num_seeds",
"total_seeds",
"num_peers",
"total_peers",
"eta",
"download_payload_rate",
"upload_payload_rate",
"ratio",
"distributed_copies",
"num_pieces",
"piece_length",
"total_done",
"files",
"file_priorities",
"file_progress",
"peers",
"is_seed",
"is_finished",
"active_time",
"seeding_time")
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { DebugIncoming [][]byte // contains filtered or unexported fields }
Client is a Deluge RPC client.
func (*Client) AddTorrentFile ¶ added in v0.3.1
func (*Client) AddTorrentMagnet ¶
AddTorrentMagnet adds a torrent via magnet URI and returns the torrent hash.
func (*Client) AddTorrentURL ¶ added in v0.3.1
AddTorrentURL adds a torrent via a URL and returns the torrent hash.
func (*Client) Connect ¶
Connect performs connection to a Deluge daemon second previously specified settings.
func (*Client) DaemonVersion ¶
DaemonVersion returns the running daemon version.
func (*Client) DeleteTorrent ¶ added in v0.3.1
func (*Client) GetFreeSpace ¶ added in v0.3.1
GetFreeSpace returns the available free space; path is optional.
func (*Client) MethodsList ¶
MethodsList returns a list of available methods on server.
func (*Client) MoveStorage ¶ added in v0.3.1
func (*Client) SessionState ¶ added in v0.3.1
func (*Client) TorrentsStatus ¶ added in v0.3.1
func (c *Client) TorrentsStatus() (map[string]*TorrentStatus, error)
type DelugeClient ¶ added in v0.3.1
type DelugeClient interface { MethodsList() ([]string, error) DaemonVersion() (string, error) GetFreeSpace(string) (int64, error) AddTorrentMagnet(magnetURI string, options Options) (string, error) AddTorrentFile(fileName, fileContentBase64 string, options Options) (string, error) AddTorrentURL(url string, options Options) (string, error) DeleteTorrent(id string) (bool, error) TorrentsStatus() (map[string]*TorrentStatus, error) MoveStorage(torrentIDs []string, dest string) error SessionState() ([]string, error) }
type DelugeResponse ¶
type DelugeResponse struct { // only in rpcError RPCError // contains filtered or unexported fields }
DelugeResponse is a response returned from a completed RPC call.
func (*DelugeResponse) IsError ¶
func (dr *DelugeResponse) IsError() bool
IsError returns true when the response is an error.
func (*DelugeResponse) String ¶
func (dr *DelugeResponse) String() string
type NativeDelugeClient ¶ added in v0.3.1
type Options ¶ added in v0.3.1
type Options map[string]interface{}
Options used when adding a torrent magnet/URL
type SerialMismatchError ¶ added in v0.3.1
func (SerialMismatchError) Error ¶ added in v0.3.1
func (e SerialMismatchError) Error() string
type Settings ¶
type Settings struct { Hostname string Port uint Login string Password string Logger *log.Logger ReadWriteTimeout time.Duration // Timeout for read/write operations on the TCP stream. DebugSaveInteractions bool }
Settings defines all settings for a Deluge client connection.
type TorrentStatus ¶ added in v0.3.1
type TorrentStatus struct { NumSeeds int64 Ratio float32 Progress float32 // max is 100 DistributedCopies float32 TotalDone int64 SeedingTime int64 ETA float32 // most times an integer IsFinished bool NumPieces int64 TrackerHost string PieceLength int64 ActiveTime int64 IsSeed bool NumPeers int64 NextAnnounce int64 Name string State string TotalSeeds int64 TotalPeers int64 DownloadPayloadRate int64 UploadPayloadRate int64 TrackerStatus string TotalSize int64 Files []File Peers []Peer FilePriorities []int64 FileProgress []float32 }
Directories ¶
Path | Synopsis |
---|---|
* go-libdeluge v0.2.0 - a native deluge RPC client library * Copyright (C) 2015~2017 gdm85 - https://github.com/gdm85/go-libdeluge/ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
|
* go-libdeluge v0.2.0 - a native deluge RPC client library * Copyright (C) 2015~2017 gdm85 - https://github.com/gdm85/go-libdeluge/ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. |