Documentation ¶
Overview ¶
Package delrpc provides a idiomatic Go client for Deluge RPC hosts.
See: https://deluge.readthedocs.io/en/latest/reference/api.html
Index ¶
- Constants
- type Client
- type ClientOption
- func WithCredentialFallback(user, pass string) ClientOption
- func WithHost(host string) ClientOption
- func WithLogf(reqf, resf func(string, ...interface{})) ClientOption
- func WithTimeout(timeout time.Duration) ClientOption
- func WithURL(urlstr string) ClientOption
- func WithUserAgent(userAgent string) ClientOption
- type Error
Constants ¶
const ( // DefaultTimeout is the default client timeout. DefaultTimeout = 10 * time.Second // DefaultUserAgent is the default client user agent. DefaultUserAgent = "delrpc/0.1" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
Client is a deluge rpc client.
func NewClient ¶
func NewClient(opts ...ClientOption) *Client
NewClient creates a new deluge rpc client.
type ClientOption ¶
type ClientOption = func(*Client)
ClientOption is a deluge rpc client option.
func WithCredentialFallback ¶
func WithCredentialFallback(user, pass string) ClientOption
WithCredentialFallback is a deluge rpc client option to set the credential fallback to send to the rpc host.
func WithHost ¶
func WithHost(host string) ClientOption
WithHost is a deluge rpc client option to set the remote host. Remote URL will become 'http://<host>/transmission/rpc'.
func WithLogf ¶
func WithLogf(reqf, resf func(string, ...interface{})) ClientOption
WithLogf is a deluge rpc client option to set logging handlers HTTP request and response bodies.
func WithTimeout ¶
func WithTimeout(timeout time.Duration) ClientOption
WithTimeout is a deluge rpc client option to set the rpc host request tiemout.
func WithURL ¶
func WithURL(urlstr string) ClientOption
WithURL is a deluge rpc client option to set the remote URL.
func WithUserAgent ¶
func WithUserAgent(userAgent string) ClientOption
WithUserAgent is a deluge rpc client option to set the user agent sent to the rpc host.