forked from ElementumOrg/libtorrent-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsession.go
36 lines (28 loc) · 764 Bytes
/
session.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
package libtorrent
// Session is a wrapper for libtorrent::session
type Session interface {
WrappedSession
GetHandle() (SessionHandle, error)
}
// SessionImpl ...
type SessionImpl struct {
WrappedSession
}
// NewSession is a wrapper for libtorrent::session
func NewSession(a ...interface{}) (ret Session, err error) {
defer catch(&err)
ret = SessionImpl{NewWrappedSession(a...)}
return
}
// DeleteSession is a wrapper for libtorrent::session
func DeleteSession(arg1 Session) (err error) {
defer catch(&err)
DeleteWrappedSession(arg1)
return
}
// GetHandle is a wrapper for libtorrent::session::get_handle
func (p SessionImpl) GetHandle() (ret SessionHandle, err error) {
defer catch(&err)
ret = SessionHandleImpl{p.WrappedGetHandle()}
return
}