Documentation ¶
Index ¶
- type Error
- type Peer
- type Status
- type Torrent
- type TorrentAddRequest
- type TorrentAddResponse
- type TorrentGetRequest
- type TorrentGetResponse
- type TorrentRemoveRequest
- type TorrentSetRequest
- type TorrentStartNowRequest
- type TorrentStopRequest
- type Transmission
- func (t *Transmission) Add(d TorrentAddRequest) (*TorrentAddResponse, error)
- func (t *Transmission) Do(req *http.Request, v interface{}) error
- func (t *Transmission) Get(d TorrentGetRequest) (*TorrentGetResponse, error)
- func (c *Transmission) NewRequest(method string, arguments interface{}) (*http.Request, error)
- func (t *Transmission) Remove(d TorrentRemoveRequest) error
- func (t *Transmission) Set(d TorrentSetRequest) error
- func (t *Transmission) StartNow(ids ...int) error
- func (t *Transmission) Stop(ids ...int) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Peer ¶
type Peer struct { IsEncrypted bool `json:"isEncrypted"` PeerIsInterested bool `json:"peerIsInterested"` ClientIsInterested bool `json:"clientIsInterested"` ClientName string `json:"clientName"` IsDownloadingFrom bool `json:"isDownloadingFrom"` IsIncoming bool `json:"isIncoming"` IsUploadingTo bool `json:"isUploadingTo"` Port int `json:"port"` Progress float64 `json:"progress"` RateToPeer float64 `json:"rateToPeer"` Flag string `json:"flagStr"` Address string `json:"address"` ClientIsChoked bool `json:"clientIsChoked"` PeerIsChoked bool `json:"peerIsChoked"` IsUTP bool `json:"isUTP"` }
type Torrent ¶
type Torrent struct { Error int64 `json:"error"` ErrorString string `json:"errorString"` Files []struct { BytesCompleted int64 `json:"bytesCompleted"` Length int64 `json:"length"` Name string `json:"name"` } `json:"files"` HaveValid int64 `json:"haveValid"` ID int64 `json:"id"` IsFinished bool `json:"isFinished"` Name string `json:"name"` Peers []Peer `json:"peers"` PercentDone float64 `json:"percentDone"` RateDownload int64 `json:"rateDownload"` RateUpload int64 `json:"rateUpload"` Status Status `json:"status"` TotalSize int64 `json:"totalSize"` MetadataPercentComplete float64 `json:"metadataPercentComplete"` Hash string `json:"hashString"` }
type TorrentAddRequest ¶
type TorrentAddRequest struct {
Filename string `json:"filename,omitempty"`
}
type TorrentAddResponse ¶
type TorrentGetRequest ¶
type TorrentGetResponse ¶
type TorrentGetResponse struct {
Torrents []Torrent `json:"torrents"`
}
type TorrentRemoveRequest ¶
type TorrentSetRequest ¶
type TorrentStartNowRequest ¶
type TorrentStartNowRequest struct {
IDs []int `json:"ids,omitempty"`
}
type TorrentStopRequest ¶
type TorrentStopRequest struct {
IDs []int `json:"ids,omitempty"`
}
type Transmission ¶
type Transmission struct {
// contains filtered or unexported fields
}
func New ¶
func New(url string) *Transmission
func (*Transmission) Add ¶
func (t *Transmission) Add(d TorrentAddRequest) (*TorrentAddResponse, error)
func (*Transmission) Get ¶
func (t *Transmission) Get(d TorrentGetRequest) (*TorrentGetResponse, error)
func (*Transmission) NewRequest ¶
func (c *Transmission) NewRequest(method string, arguments interface{}) (*http.Request, error)
func (*Transmission) Remove ¶
func (t *Transmission) Remove(d TorrentRemoveRequest) error
func (*Transmission) Set ¶
func (t *Transmission) Set(d TorrentSetRequest) error
func (*Transmission) StartNow ¶
func (t *Transmission) StartNow(ids ...int) error
func (*Transmission) Stop ¶
func (t *Transmission) Stop(ids ...int) error
Click to show internal directories.
Click to hide internal directories.