v2

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2019 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TorrentStateError              = "error"              // Some error occurred, applies to paused torrents
	TorrentStateMissingFiles       = "missingFiles"       // Torrent data files is missing
	TorrentStateUploading          = "uploading"          // Torrent is being seeded and data is being transferred
	TorrentStatePausedUP           = "pausedUP"           // Torrent is paused and has finished downloading
	TorrentStateQueuedUP           = "queuedUP"           // Queuing is enabled and torrent is queued for upload
	TorrentStateStalledUP          = "stalledUP"          // Torrent is being seeded, but no connection were made
	TorrentStateCheckingUP         = "checkingUP"         // Torrent has finished downloading and is being checked
	TorrentStateForcedUP           = "forcedUP"           // Torrent is forced to uploading and ignore queue limit
	TorrentStateAllocating         = "allocating"         // Torrent is allocating disk space for download
	TorrentStateDownloading        = "downloading"        // Torrent is being downloaded and data is being transferred
	TorrentStateMetaDL             = "metaDL"             // Torrent has just started downloading and is fetching metadata
	TorrentStatePausedDL           = "pausedDL"           // Torrent is paused and has NOT finished downloading
	TorrentStateQueuedDL           = "queuedDL"           // Queuing is enabled and torrent is queued for download
	TorrentStateStalledDL          = "stalledDL"          // Torrent is being downloaded, but no connection were made
	TorrentStateCheckingDL         = "checkingDL"         // Same as checkingUP, but torrent has NOT finished downloading
	TorrentStateForceDL            = "forceDL"            // Torrent is forced to downloading to ignore queue limit
	TorrentStateCheckingResumeData = "checkingResumeData" // Checking resume data on qBt startup
	TorrentStateMoving             = "moving"             // Torrent is moving to another location
	TorrentStateUnknown            = "unknown"            // Unknown status
)

.

Variables

View Source
var (
	ErrNoImplementation = errors.New("No implementation")
)

.

Functions

This section is empty.

Types

type Client

type Client struct {
	BaseURL   string
	Cookies   http.CookieJar
	Host      string
	Authorize string
	// contains filtered or unexported fields
}

Client .

func New

func New(baseURL string) (*Client, error)

New .

func (*Client) GetAPIVersion

func (c *Client) GetAPIVersion() (string, error)

GetAPIVersion .

func (*Client) GetBuildInfo

func (c *Client) GetBuildInfo() (string, error)

GetBuildInfo .

func (*Client) GetDefaultSavePath

func (c *Client) GetDefaultSavePath() (string, error)

GetDefaultSavePath .

func (*Client) GetPreferences

func (c *Client) GetPreferences() error

GetPreferences .

func (*Client) GetTorrentGenericProperties

GetTorrentGenericProperties .

func (*Client) GetTorrentList

func (c *Client) GetTorrentList(req *GetTorrentListRequest) (*GetTorrentListResponse, error)

GetTorrentList .

func (*Client) GetTorrentPiecesHash

func (c *Client) GetTorrentPiecesHash()

GetTorrentPiecesHash .

func (*Client) GetTorrentPiecesStates

func (c *Client) GetTorrentPiecesStates()

GetTorrentPiecesStates .

func (*Client) GetTorrentTrackers

func (c *Client) GetTorrentTrackers(req *GetTorrentTrackersRequest) (*GetTorrentTrackersResponse, error)

GetTorrentTrackers .

func (*Client) GetTorrentWebSeeds

func (c *Client) GetTorrentWebSeeds()

GetTorrentWebSeeds .

func (*Client) GetVersion

func (c *Client) GetVersion() (string, error)

GetVersion .

func (*Client) Login

func (c *Client) Login(username, password string) error

Login .

func (*Client) Logout

func (c *Client) Logout() error

Logout .

func (*Client) SetPreferences

func (c *Client) SetPreferences() error

SetPreferences .

func (*Client) Shutdown

func (c *Client) Shutdown() error

Shutdown .

func (*Client) TorrentAdd

func (c *Client) TorrentAdd(req *TorrentAddRequest) error

TorrentAdd .

func (*Client) TorrentAddTracker

func (c *Client) TorrentAddTracker()

TorrentAddTracker .

func (*Client) TorrentAddURL

func (c *Client) TorrentAddURL()

TorrentAddURL .

func (*Client) TorrentDelete

func (c *Client) TorrentDelete()

TorrentDelete .

func (*Client) TorrentEditTracker

func (c *Client) TorrentEditTracker()

TorrentEditTracker .

func (*Client) TorrentPause

func (c *Client) TorrentPause()

TorrentPause .

func (*Client) TorrentReannounce

func (c *Client) TorrentReannounce()

TorrentReannounce .

func (*Client) TorrentRecheck

func (c *Client) TorrentRecheck()

TorrentRecheck .

func (*Client) TorrentRemoveTracker

func (c *Client) TorrentRemoveTracker()

TorrentRemoveTracker .

func (*Client) TorrentResume

func (c *Client) TorrentResume()

TorrentResume .

type GetTorrentGenericPropertiesRequest

type GetTorrentGenericPropertiesRequest struct {
	Hash string
}

GetTorrentGenericPropertiesRequest .

type GetTorrentGenericPropertiesResponse

type GetTorrentGenericPropertiesResponse struct {
	TorrentProperties TorrentProperties
}

GetTorrentGenericPropertiesResponse .

type GetTorrentListRequest

type GetTorrentListRequest struct {
	Filter   string
	Category string
	Sort     string
	Reverse  string
	Limit    int
	Offset   int
	Hashes   []string
}

GetTorrentListRequest .

type GetTorrentListResponse

type GetTorrentListResponse struct {
	Torrents []Torrent
}

GetTorrentListResponse .

type GetTorrentTrackersRequest

type GetTorrentTrackersRequest struct {
	Hash string
}

GetTorrentTrackersRequest .

type GetTorrentTrackersResponse

type GetTorrentTrackersResponse struct {
	TorrentTracker TorrentTracker
}

GetTorrentTrackersResponse .

type Preferences

type Preferences struct{}

Preferences .

type Torrent

type Torrent struct {
	Hash          string  `json:"hash,omitempty"`
	Name          string  `json:"name,omitempty"`
	Size          int     `json:"size,omitempty"`
	Progress      float32 `json:"progress,omitempty"`
	DownloadSpeed int     `json:"dlspeed,omitempty"`
	UploadSpeed   int     `json:"upspeed,omitempty"`
	Priority      int     `json:"priority,omitempty"`
	NumSeeds      int     `json:"num_seeds,omitempty"`
	NumComplete   int     `json:"num_complete,omitempty"`
	NumLeechs     int     `json:"num_leechs,omitempty"`
	NumIncomplete int     `json:"num_incomplete,omitempty"`
	Ratio         int     `json:"ratio,omitempty"`
	ETA           int     `json:"eta,omitempty"`
	State         string  `json:"state,omitempty"`
	SeqDl         bool    `json:"seq_dl,omitempty"`
	FLPiecePrio   bool    `json:"f_l_piece_prio,omitempty"`
	Category      string  `json:"category,omitempty"`
	SuperSeeding  bool    `json:"super_seeding,omitempty"`
	ForceStart    bool    `json:"force_start,omitempty"`
}

Torrent .

type TorrentAddRequest

type TorrentAddRequest struct {
	Files  []string
	Option struct {
		SavePath           string
		Cookie             string
		Category           string
		SkipChecking       bool
		Paused             bool
		RootFolder         bool
		Rename             string
		UploadLimit        uint64
		DownloadLimit      uint64
		SequentialDownload bool
		FirstLastPiecePrio bool
	}
}

TorrentAddRequest .

type TorrentAddResponse

type TorrentAddResponse struct{}

TorrentAddResponse .

type TorrentProperties

type TorrentProperties struct {
	SavePath               string  `json:",save_path,omitempty"`
	CreationDate           int     `json:",creation_date,omitempty"`
	PieceSize              int     `json:",piece_size,omitempty"`
	Comment                string  `json:",comment,omitempty"`
	TotalWasted            int     `json:",total_wasted,omitempty"`
	TotalUploaded          int     `json:",total_uploaded,omitempty"`
	TotalUploadedSession   int     `json:",total_uploaded_session,omitempty"`
	TotalDownloaded        int     `json:",total_downloaded,omitempty"`
	TotalDownloadedSession int     `json:",total_downloaded_session,omitempty"`
	UpLimit                int     `json:",up_limit,omitempty"`
	DlLimit                int     `json:",dl_limit,omitempty"`
	TimeElapsed            int     `json:",time_elapsed,omitempty"`
	SeedingTime            int     `json:",seeding_time,omitempty"`
	NbConnections          int     `json:",nb_connections,omitempty"`
	NbConnectionsLimit     int     `json:",nb_connections_limit,omitempty"`
	ShareRatio             float32 `json:",share_ratio,omitempty"`
	AdditionDate           int     `json:",addition_date,omitempty"`
	CompletionDate         int     `json:",completion_date,omitempty"`
	CreatedBy              string  `json:",created_by,omitempty"`
	DlSpeedAvg             int     `json:",dl_speed_avg,omitempty"`
	DlSpeed                int     `json:",dl_speed,omitempty"`
	Eta                    int     `json:",eta,omitempty"`
	LastSeen               int     `json:",last_seen,omitempty"`
	Peers                  int     `json:",peers,omitempty"`
	PeersTotal             int     `json:",peers_total,omitempty"`
	PiecesHave             int     `json:",pieces_have,omitempty"`
	PiecesNum              int     `json:",pieces_num,omitempty"`
	Reannounce             int     `json:",reannounce,omitempty"`
	Seeds                  int     `json:",seeds,omitempty"`
	SeedsTotal             int     `json:",seeds_total,omitempty"`
	TotalSize              int     `json:",total_size,omitempty"`
	UpSpeedAvg             int     `json:",up_speed_avg,omitempty"`
	UpSpeed                int     `json:",up_speed,omitempty"`
}

TorrentProperties .

type TorrentState

type TorrentState string

TorrentState .

type TorrentTracker

type TorrentTracker struct {
	URL           string `json:"url,omitempty"`            // Tracker url
	Status        int    `json:"status,omitempty"`         // Tracker status. See the table below for possible values
	Tier          int    `json:"tier,omitempty"`           // Tracker priority tier. Lower tier trackers are tried before higher tiers
	NumPeers      int    `json:"num_peers,omitempty"`      // Number of peers for current torrent, as reported by the tracker
	NumSeeds      int    `json:"num_seeds,omitempty"`      // Number of seeds for current torrent, asreported by the tracker
	NumLeeches    int    `json:"num_leeches,omitempty"`    // Number of leeches for current torrent, as reported by the tracker
	NumDownloaded int    `json:"num_downloaded,omitempty"` // Number of completed downlods for current torrent, as reported by the tracker
	Msg           string `json:"msg,omitempty"`            // Tracker message (there is no way of knowing what this message is - it's up to tracker admins)
}

TorrentTracker .

Jump to

Keyboard shortcuts

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