delugeclient

package module
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 21, 2016 License: GPL-2.0 Imports: 9 Imported by: 10

README

go-libdeluge

Go library for native RPC connection to a Deluge daemon; it uses go-rencode for the RPC protocol serialization/deserialization.

Release blog post.

License

GNU GPL version 2

How to build

This project uses an automatically-provisioned GOPATH. Example init/building commands on a Linux system:

git submodule update --init --recursive
make

How to use

The library by itself is a Go package and needs to be embedded in an UI or CLI application.

Example: add-torrent

The example add-torrent CLI program provided under examples can be used to add a torrent magnet URI for download:

DELUGE_PASSWORD="mypassword" bin/add-torrent magnet:?xt=urn:btih:C1939CA413B9AFCC34EA0CF3C128574E93FF6CB0&tr=http%3A%2F%2Ftorrent.ubuntu.com%3A6969%2Fannounce

This will start downloading the latest Ubuntu 14.04 LTS server ISO. Multiple magnet URIs are supported as command-line arguments; run bin/add-torrent alone to see all available options and their description.

Documentation

Overview

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

This section is empty.

Variables

View Source
var (
	// ErrAlreadyClosed is returned when connection is already closed.
	ErrAlreadyClosed = errors.New("connection is already closed")
)

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client is a Deluge RPC client.

func New

func New(s Settings) *Client

New returns a Deluge client.

func (*Client) AddTorrentMagnet

func (c *Client) AddTorrentMagnet(magnetURI string) (string, error)

AddTorrentMagnet adds a torrent via magnet URI and returns the torrent hash.

func (*Client) Close

func (c *Client) Close() error

Close closes the connection of a Deluge client.

func (*Client) Connect

func (c *Client) Connect() error

Connect performs connection to a Deluge daemon second previously specified settings.

func (*Client) DaemonVersion

func (c *Client) DaemonVersion() (string, error)

DaemonVersion returns the running daemon version.

func (*Client) MethodsList

func (c *Client) MethodsList() ([]string, error)

MethodsList returns a list of available methods on server.

type DelugeResponse

type DelugeResponse struct {
	// 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 RPCError

type RPCError struct {
	// contains filtered or unexported fields
}

RPCError is an error returned by RPC calls.

func (RPCError) Error

func (e RPCError) Error() string

type Settings

type Settings struct {
	Hostname string
	Port     uint
	Login    string
	Password string
	Logger   *log.Logger
}

Settings defines all settings for a Deluge client connection.

Directories

Path Synopsis
* go-libdeluge v0.1.0 - a native deluge RPC client library * Copyright (C) 2015~2016 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.1.0 - a native deluge RPC client library * Copyright (C) 2015~2016 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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL