forked from ElementumOrg/libtorrent-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
session_handle.go
38 lines (30 loc) · 1 KB
/
session_handle.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package libtorrent
// SessionHandle is a wrapper for libtorrent::session_handle
type SessionHandle interface {
WrappedSessionHandle
AddTorrent(...interface{}) (TorrentHandle, error)
AsyncAddTorrent(AddTorrentParams) error
RemoveTorrent(...interface{}) error
}
// SessionHandleImpl ...
type SessionHandleImpl struct {
WrappedSessionHandle
}
// AddTorrent is a wrapper for libtorrent::session_handle::add_torrent
func (p SessionHandleImpl) AddTorrent(a ...interface{}) (ret TorrentHandle, err error) {
defer catch(&err)
ret = TorrentHandleImpl{p.WrappedAddTorrent(a...)}
return
}
// AsyncAddTorrent is a wrapper for libtorrent::session_handle::async_add_torrent
func (p SessionHandleImpl) AsyncAddTorrent(arg2 AddTorrentParams) (err error) {
defer catch(&err)
p.WrappedAsyncAddTorrent(arg2)
return
}
// RemoveTorrent is a wrapper for libtorrent::session_handle::remove_torrent
func (p SessionHandleImpl) RemoveTorrent(a ...interface{}) (err error) {
defer catch(&err)
p.WrappedRemoveTorrent(a...)
return
}