Documentation
¶
Index ¶
- func CORSMiddleware(next http.Handler) http.Handler
- func LoadHandler(rt *Rtorrent) http.HandlerFunc
- func SystemHandler(rt *Rtorrent) http.HandlerFunc
- func ThrottleHandler(rt *Rtorrent) http.HandlerFunc
- func TorrentHandler(rt *Rtorrent) http.HandlerFunc
- func ViewHandler(rt *Rtorrent) http.HandlerFunc
- type Config
- type ErrorResponse
- type File
- type FilesResponse
- type Peer
- type PeersResponse
- type Response
- type Rtorrent
- func (rt *Rtorrent) CheckHash(hash string) error
- func (rt *Rtorrent) Close() error
- func (rt *Rtorrent) DMulticall(target string, args interface{}) ([]Torrent, error)
- func (rt *Rtorrent) Erase(hash string) error
- func (rt *Rtorrent) FMulticall(args interface{}) ([]File, error)
- func (rt *Rtorrent) GlobalThrottleDown(kilobytes int) error
- func (rt *Rtorrent) GlobalThrottleUp(kilobytes int) error
- func (rt *Rtorrent) ListMethods() ([]string, error)
- func (rt *Rtorrent) LoadRawStart(file []byte) error
- func (rt *Rtorrent) PMulticall(args interface{}) ([]Peer, error)
- func (rt *Rtorrent) Pause(hash string) error
- func (rt *Rtorrent) Priority(hash string, priority int) error
- func (rt *Rtorrent) Resume(hash string) error
- func (rt *Rtorrent) Start(hash string) error
- func (rt *Rtorrent) Stop(hash string) error
- func (rt *Rtorrent) SystemMulticall(args interface{}) (System, error)
- func (rt *Rtorrent) TMulticall(args interface{}) ([]Tracker, error)
- type System
- type SystemCall
- type SystemResponse
- type ThrottleRequest
- type Torrent
- type TorrentPriorityRequest
- type Tracker
- type TrackersResponse
- type ViewResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LoadHandler ¶
func LoadHandler(rt *Rtorrent) http.HandlerFunc
func SystemHandler ¶
func SystemHandler(rt *Rtorrent) http.HandlerFunc
func ThrottleHandler ¶
func ThrottleHandler(rt *Rtorrent) http.HandlerFunc
func TorrentHandler ¶
func TorrentHandler(rt *Rtorrent) http.HandlerFunc
func ViewHandler ¶
func ViewHandler(rt *Rtorrent) http.HandlerFunc
Types ¶
type Config ¶
type Config struct {
URL string
Transport http.RoundTripper
}
type ErrorResponse ¶
type File ¶
type File struct {
Path string `rt:"f.path=" json:"path"`
Size int64 `rt:"f.size_bytes=" json:"size"`
SizeChunks int64 `rt:"f.size_chunks=" json:"size_chunks"`
CompletedChunks int64 `rt:"f.completed_chunks=" json:"completed_chunks"`
FrozenPath string `rt:"f.frozen_path=" json:"frozen_path"`
Priority int64 `rt:"f.priority=" json:"priority"`
IsCreated int64 `rt:"f.is_created=" json:"is_created"`
IsOpen int64 `rt:"f.is_open=" json:"is_open"`
}
type FilesResponse ¶
type Peer ¶
type Peer struct {
ID string `rt:"p.id=" json:"id"`
Address string `rt:"p.address=" json:"address"`
Port int64 `rt:"p.port=" json:"port"`
Banned int64 `rt:"p.banned=" json:"banned"`
ClientVersion string `rt:"p.client_version=" json:"client_version"`
CompletedPercent int64 `rt:"p.completed_percent=" json:"completed_percent"`
IsEncrypted int64 `rt:"p.is_encrypted=" json:"is_encrypted"`
IsIncoming int64 `rt:"p.is_incoming=" json:"is_incoming"`
IsObfuscated int64 `rt:"p.is_obfuscated=" json:"is_obfuscated"`
DownloadRate int64 `rt:"p.peer_rate=" json:"down_rate"`
DownloadTotal int64 `rt:"p.peer_total=" json:"down_total"`
UploadRate int64 `rt:"p.up_rate=" json:"up_rate"`
UploadTotal int64 `rt:"p.up_total=" json:"up_total"`
}
type PeersResponse ¶
type Rtorrent ¶
type Rtorrent struct {
// contains filtered or unexported fields
}
func NewRtorrent ¶
Creates a new instance of Rtorrent client
func (*Rtorrent) DMulticall ¶
View multicall.
func (*Rtorrent) FMulticall ¶
File multicall.
func (*Rtorrent) GlobalThrottleDown ¶
Set global down throttle.
func (*Rtorrent) GlobalThrottleUp ¶
Set global up throttle.
func (*Rtorrent) ListMethods ¶
Lists available XMLRPC methods
func (*Rtorrent) LoadRawStart ¶
Load and start a torrent
func (*Rtorrent) PMulticall ¶
Peer multicall.
func (*Rtorrent) SystemMulticall ¶
System multicall.
func (*Rtorrent) TMulticall ¶
Torrent multicall.
type System ¶
type System struct {
APIVersion string `rt:"system.api_version" json:"api_version"`
ClientVersion string `rt:"system.client_version" json:"client_version"`
LibraryVersion string `rt:"system.library_version" json:"library_version"`
Hostname string `rt:"system.hostname" json:"hostname"`
PID int64 `rt:"system.pid" json:"pid"`
Time int64 `rt:"system.time_seconds" json:"time_seconds"`
ThrottleGlobalDownTotal int64 `rt:"throttle.global_down.total" json:"throttle_global_down_total"`
ThrottleGlobalUpTotal int64 `rt:"throttle.global_up.total" json:"throttle_global_up_total"`
ThrottleGlobalDownRate int64 `rt:"throttle.global_down.rate" json:"throttle_global_down_rate"`
ThrottleGlobalUpRate int64 `rt:"throttle.global_up.rate" json:"throttle_global_up_rate"`
ThrottleGlobalDownMaxRate int64 `rt:"throttle.global_down.max_rate" json:"throttle_global_down_max_rate"`
ThrottleGlobalUpMaxRate int64 `rt:"throttle.global_up.max_rate" json:"throttle_global_up_max_rate"`
}
type SystemCall ¶
type SystemCall struct {
MethodName string `xmlrpc:"methodName" json:"method_name"`
Params interface{} `xmlrpc:"params" json:"params"`
}
type SystemResponse ¶
type ThrottleRequest ¶
type Torrent ¶
type Torrent struct {
Hash string `rt:"d.hash=" json:"hash"`
Name string `rt:"d.name=" json:"name"`
SizeBytes int64 `rt:"d.size_bytes=" json:"size_bytes"`
CompletedBytes int64 `rt:"d.completed_bytes=" json:"completed_bytes"`
UploadRate int64 `rt:"d.up.rate=" json:"upload_rate"`
UploadTotal int64 `rt:"d.up.total=" json:"upload_total"`
DownloadRate int64 `rt:"d.down.rate=" json:"download_rate"`
DownloadTotal int64 `rt:"d.down.total=" json:"download_total"`
Message string `rt:"d.message=" json:"message"`
BaseFilename string `rt:"d.base_filename=" json:"base_filename"`
BasePath string `rt:"d.base_path=" json:"base_path"`
IsActive int64 `rt:"d.is_active=" json:"is_active"`
IsOpen int64 `rt:"d.is_open=" json:"is_open"`
IsHashing int64 `rt:"d.is_hash_checking=" json:"is_hashing"`
Leechers int64 `rt:"d.peers_accounted=" json:"leechers"`
Seeders int64 `rt:"d.peers_complete=" json:"seeders"`
State int64 `rt:"d.state=" json:"state"`
StateChanged int64 `rt:"d.state_changed=" json:"state_changed"`
StateCounter int64 `rt:"d.state_counter=" json:"state_counter"`
Priority int64 `rt:"d.priority=" json:"priority"`
Custom1 string `rt:"d.custom1=" json:"custom1"`
Custom2 string `rt:"d.custom2=" json:"custom2"`
Custom3 string `rt:"d.custom3=" json:"custom3"`
Custom4 string `rt:"d.custom4=" json:"custom4"`
Custom5 string `rt:"d.custom5=" json:"custom5"`
}
type TorrentPriorityRequest ¶
type TorrentPriorityRequest struct {
Priority int `json:"priority"`
}
type Tracker ¶
type Tracker struct {
ID string `rt:"t.id=" json:"tracker_id"`
ActivityTimeLast int64 `rt:"t.activity_time_last=" json:"activity_time_last"`
ActivityTimeNext int64 `rt:"t.activity_time_next=" json:"activity_time_next"`
CanScrape int64 `rt:"t.can_scrape=" json:"can_scrape"`
IsUsable int64 `rt:"t.is_usable=" json:"t.is_usable"`
IsEnabled int64 `rt:"t.is_enabled=" json:"is_enabled"`
FailedCounter int64 `rt:"t.failed_counter=" json:"failed_counter"`
FailedTimeLast int64 `rt:"t.failed_time_last=" json:"failed_time_last"`
FailedTimeNext int64 `rt:"t.failed_time_next=" json:"failed_time_next"`
LatestEvent string `rt:"t.latest_event=" json:"latest_event"`
IsBusy int64 `rt:"t.is_busy=" json:"is_busy"`
IsOpen int64 `rt:"t.is_open=" json:"is_open"`
Type int64 `rt:"t.type=" json:"type"`
URL string `rt:"t.url=" json:"url"`
}
