transmission

package module
v0.0.0-...-005a09f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 22, 2016 License: BSD-3-Clause Imports: 6 Imported by: 0

README

gotransmission

Transmission RPC Library for Go

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Error

type Error struct {
	Result string
}

func (*Error) Error

func (e *Error) Error() string

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 Status

type Status uint64
const (
	StatusStopped Status = iota
	StatusCheckWait
	StatusCheck
	StatusDownloadWait
	StatusDownload
	StatusSeedWait
	StatusSeed
)

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 TorrentAddResponse struct {
	TorrentAdded struct {
		Hash string `json:"hashString"`
		ID   int    `json:"id"`
		Name string `json:"name"`
	} `json:"torrent-added"`
}

type TorrentGetRequest

type TorrentGetRequest struct {
	IDs    []int    `json:"ids,omitempty"`
	Fields []string `json:"fields,omitempty"`
}

type TorrentGetResponse

type TorrentGetResponse struct {
	Torrents []Torrent `json:"torrents"`
}

type TorrentRemoveRequest

type TorrentRemoveRequest struct {
	IDs             []int `json:"ids,omitempty"`
	DeleteLocalData bool  `json:"delete-local-data"`
}

type TorrentSetRequest

type TorrentSetRequest struct {
	IDs           []int `json:"ids,omitempty"`
	FilesWanted   []int `json:"files-wanted"`
	FilesUnwanted []int `json:"files-unwanted"`
}

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 (*Transmission) Do

func (t *Transmission) Do(req *http.Request, v interface{}) error

func (*Transmission) Get

func (*Transmission) NewRequest

func (c *Transmission) NewRequest(method string, arguments interface{}) (*http.Request, error)

func (*Transmission) Remove

func (*Transmission) Set

func (*Transmission) StartNow

func (t *Transmission) StartNow(ids ...int) error

func (*Transmission) Stop

func (t *Transmission) Stop(ids ...int) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL