qbapi

package
v0.7.4 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2023 License: MIT Imports: 17 Imported by: 0

README

qbapi

golang 版本的qbittorrent webui api, 实现API v2.8.3的大部分功能(除RSS, Search)

基本使用

func main() {
	var opts []Option
	opts = append(opts, WithAuth("xxxtest", "ruok123"))
	opts = append(opts, WithHost("https://torrent.abc.com"))
	api, err := NewAPI(opts...)
	if err != nil {
		panic(err)
	}
	if err := api.Login(context.Background()); err != nil {
		panic(err)
	}
    rsp, err := api.GetApplicationVersion(context.Background(), &GetApplicationVersionReq{})
    if err != nil {
        panic(err)
    }
    fmt.Printf("rsp:%+v", rsp)
}

Documentation

Index

Constants

View Source
const (
	ErrOK         = 0
	ErrParams     = -10000
	ErrUnmarsal   = -10001
	ErrMarsal     = -10002
	ErrInternal   = -10003
	ErrNetwork    = -10004
	ErrStatusCode = -10005
	ErrLogin      = -10006
	ErrUnknown    = -10007
	ErrFile       = -10008
)
View Source
const (
	FilePriorityDoNotDownload = 0
	FilePriorityNormal        = 1
	FilePriorityHigh          = 6
	FilePriorityMaximal       = 7
)

Variables

View Source
var (
	JsonDec = json.Unmarshal
	StrDec  = strDec
	IntDec  = intDec
)

Functions

func IterStruct

func IterStruct(in interface{}, tagName string, cb func(k string, value interface{}) error) error

func RootCause

func RootCause(err error) (int, error)

func ToMap

func ToMap(in interface{}, tagName string) (map[string]string, error)

Types

type AddNewCategoryReq

type AddNewCategoryReq struct {
	Category string `json:"category"`
	SavePath string `json:"savePath"`
}

type AddNewCategoryRsp

type AddNewCategoryRsp struct {
}

type AddNewLinkReq

type AddNewLinkReq struct {
	Url  []string
	Meta *AddTorrentMeta
}

type AddNewLinkRsp

type AddNewLinkRsp struct {
}

type AddNewTorrentReq

type AddNewTorrentReq struct {
	File []string
	Meta *AddTorrentMeta
}

type AddNewTorrentRsp

type AddNewTorrentRsp struct {
}

type AddPeersReq

type AddPeersReq struct {
	Hash []string
	Peer []string
}

type AddPeersRsp

type AddPeersRsp struct {
}

type AddTorrentMeta

type AddTorrentMeta struct {
	Savepath           *string  `json:"savepath"`           //Download folder
	Cookie             *string  `json:"cookie"`             //Cookie sent to download the .torrent file
	Category           *string  `json:"category"`           //Category for the torrent
	Tags               string   `json:"tags"`               //Tags for the torrent, split by ','
	SkipChecking       *bool    `json:"skip_checking"`      //Skip hash checking. Possible values are true, false (default)
	Paused             *bool    `json:"paused"`             //Add torrents in the paused state. Possible values are true, false (default)
	RootFolder         *bool    `json:"root_folder"`        //Create the root folder. Possible values are true, false, unset (default)
	Rename             *string  `json:"rename"`             //Rename torrent
	UpLimit            *int     `json:"upLimit"`            //Set torrent upload speed limit. Unit in bytes/second
	DlLimit            *int     `json:"dlLimit"`            //Set torrent download speed limit. Unit in bytes/second
	RatioLimit         *float64 `json:"ratioLimit"`         //Set torrent share ratio limit
	SeedingTimeLimit   *int     `json:"seedingTimeLimit"`   //Set torrent seeding time limit. Unit in seconds
	AutoTMM            *bool    `json:"autoTMM"`            //Whether Automatic Torrent Management should be used
	SequentialDownload *string  `json:"sequentialDownload"` //Enable sequential download. Possible values are true, false (default)
	FirstLastPiecePrio *string  `json:"firstLastPiecePrio"` //Prioritize download first last piece. Possible values are true, false (default)
}

type AddTorrentTagsReq

type AddTorrentTagsReq struct {
	IsAddAll bool
	Hash     []string
	Tag      []string
}

type AddTorrentTagsRsp

type AddTorrentTagsRsp struct {
}

type AddTrackersToTorrentReq

type AddTrackersToTorrentReq struct {
	Hash string
	Url  []string
}

type AddTrackersToTorrentRsp

type AddTrackersToTorrentRsp struct {
}

type BanPeersReq

type BanPeersReq struct {
	Peers []string
}

type BanPeersRsp

type BanPeersRsp struct {
}

type BuildInfo

type BuildInfo struct {
	QT         string `json:"qt"`
	Libtorrent string `json:"libtorrent"`
	Boost      string `json:"boost"`
	Openssl    string `json:"openssl"`
	Bitness    int    `json:"bitness"`
}

type CategoryInfo

type CategoryInfo struct {
	Name     string `json:"name"`
	SavePath string `json:"savePath"`
}

type Config

type Config struct {
	Username string
	Password string
	Host     string
	Timeout  time.Duration
}

type CreateTagsReq

type CreateTagsReq struct {
	Tag []string
}

type CreateTagsRsp

type CreateTagsRsp struct {
}

type Decoder

type Decoder func([]byte, interface{}) error

type DecreaseTorrentPriorityReq

type DecreaseTorrentPriorityReq struct {
	IsDecreaseAllTorrent bool
	Hash                 []string
}

type DecreaseTorrentPriorityRsp

type DecreaseTorrentPriorityRsp struct {
}

type DeleteTagsReq

type DeleteTagsReq struct {
	Tag []string
}

type DeleteTagsRsp

type DeleteTagsRsp struct {
}

type DeleteTorrentsReq

type DeleteTorrentsReq struct {
	IsDeleteAll  bool
	IsDeleteFile bool
	Hash         []string //use only IsDeleteAll set to false
}

type DeleteTorrentsRsp

type DeleteTorrentsRsp struct {
}

type EditCategoryReq

type EditCategoryReq struct {
	Category string `json:"category"`
	SavePath string `json:"savePath"`
}

type EditCategoryRsp

type EditCategoryRsp struct {
}

type EditTrackersReq

type EditTrackersReq struct {
	Hash    string `json:"hash"`
	OrigUrl string `json:"origUrl"`
	NewUrl  string `json:"newUrl"`
}

type EditTrackersRsp

type EditTrackersRsp struct {
}

type FilePriority

type FilePriority int

type GetAPIVersionReq

type GetAPIVersionReq struct {
}

type GetAPIVersionRsp

type GetAPIVersionRsp struct {
	Version string
}

type GetAllCategoriesReq

type GetAllCategoriesReq struct {
}

type GetAllCategoriesRsp

type GetAllCategoriesRsp struct {
	Categories map[string]*CategoryInfo
}

type GetAllTagsReq

type GetAllTagsReq struct {
}

type GetAllTagsRsp

type GetAllTagsRsp struct {
	Tags []string
}

type GetAlternativeSpeedLimitsStateReq

type GetAlternativeSpeedLimitsStateReq struct {
}

type GetAlternativeSpeedLimitsStateRsp

type GetAlternativeSpeedLimitsStateRsp struct {
	Enabled bool
}

type GetApplicationPreferencesReq

type GetApplicationPreferencesReq struct {
}

type GetApplicationPreferencesRsp

type GetApplicationPreferencesRsp struct {
	Locale                             string                 `json:"locale"`
	CreateSubfolderEnabled             bool                   `json:"create_subfolder_enabled"`
	StartPausedEnabled                 bool                   `json:"start_paused_enabled"`
	AutoDeleteMode                     int                    `json:"auto_delete_mode"`
	PreallocateAll                     bool                   `json:"preallocate_all"`
	IncompleteFilesExt                 bool                   `json:"incomplete_files_ext"`
	AutoTmmEnabled                     bool                   `json:"auto_tmm_enabled"`                      //True if Automatic Torrent Management is enabled by default
	TorrentChangedTmmEnabled           bool                   `json:"torrent_changed_tmm_enabled"`           //True if torrent should be relocated when its Category changes
	SavePathChangedTmmEnabled          bool                   `json:"save_path_changed_tmm_enabled"`         //True if torrent should be relocated when the default save path changes
	CategoryChangedTmmEnabled          bool                   `json:"category_changed_tmm_enabled"`          //True if torrent should be relocated when its Category's save path changes
	SavePath                           string                 `json:"save_path"`                             //Default save path for torrents, separated by slashes
	TempPathEnabled                    bool                   `json:"temp_path_enabled"`                     //True if folder for incomplete torrents is enabled
	TempPath                           string                 `json:"temp_path"`                             //Path for incomplete torrents, separated by slashes
	ScanDirs                           map[string]interface{} `json:"scan_dirs"`                             //Property: directory to watch for torrent files, value: where torrents loaded from this directory should be downloaded to (see list of possible values below). Slashes are used as path separators; multiple key/value pairs can be specified
	ExportDir                          string                 `json:"export_dir"`                            //Path to directory to copy .torrent files to. Slashes are used as path separators
	ExportDirFin                       string                 `json:"export_dir_fin"`                        //Path to directory to copy .torrent files of completed downloads to. Slashes are used as path separators
	MailNotificationEnabled            bool                   `json:"mail_notification_enabled"`             //True if e-mail notification should be enabled
	MailNotificationSender             string                 `json:"mail_notification_sender"`              //e-mail where notifications should originate from
	MailNotificationEmail              string                 `json:"mail_notification_email"`               //e-mail to send notifications to
	MailNotificationSmtp               string                 `json:"mail_notification_smtp"`                //smtp server for e-mail notifications
	MailNotificationSslEnabled         bool                   `json:"mail_notification_ssl_enabled"`         //True if smtp server requires SSL connection
	MailNotificationAuthEnabled        bool                   `json:"mail_notification_auth_enabled"`        //True if smtp server requires authentication
	MailNotificationUsername           string                 `json:"mail_notification_username"`            //Username for smtp authentication
	MailNotificationPassword           string                 `json:"mail_notification_password"`            //Password for smtp authentication
	AutorunEnabled                     bool                   `json:"autorun_enabled"`                       //True if external program should be run after torrent has finished downloading
	AutorunProgram                     string                 `json:"autorun_program"`                       //Program path/name/arguments to run if autorun_enabled is enabled; path is separated by slashes; you can use %f and %n arguments, which will be expanded by qBittorent as path_to_torrent_file and torrent_name (from the GUI; not the .torrent file name) respectively
	QueueingEnabled                    bool                   `json:"queueing_enabled"`                      //True if torrent queuing is enabled
	MaxActiveDownloads                 int                    `json:"max_active_downloads"`                  //Maximum number of active simultaneous downloads
	MaxActiveTorrents                  int                    `json:"max_active_torrents"`                   //Maximum number of active simultaneous downloads and uploads
	MaxActiveUploads                   int                    `json:"max_active_uploads"`                    //Maximum number of active simultaneous uploads
	DontCountSlowTorrents              bool                   `json:"dont_count_slow_torrents"`              //If true torrents w/o any activity (stalled ones) will not be counted towards max_active_* limits; see dont_count_slow_torrents for more information
	SlowTorrentDlRateThreshold         int                    `json:"slow_torrent_dl_rate_threshold"`        //Download rate in KiB/s for a torrent to be considered "slow"
	SlowTorrentUlRateThreshold         int                    `json:"slow_torrent_ul_rate_threshold"`        //Upload rate in KiB/s for a torrent to be considered "slow"
	SlowTorrentInactiveTimer           int                    `json:"slow_torrent_inactive_timer"`           //Seconds a torrent should be inactive before considered "slow"
	MaxRatioEnabled                    bool                   `json:"max_ratio_enabled"`                     //True if share ratio limit is enabled
	MaxRatio                           float64                `json:"max_ratio"`                             //Get the global share ratio limit
	MaxRatioAct                        int                    `json:"max_ratio_act"`                         //Action performed when a torrent reaches the maximum share ratio. See list of possible values here below.
	ListenPort                         int                    `json:"listen_port"`                           //Port for incoming connections
	Upnp                               bool                   `json:"upnp"`                                  //True if UPnP/NAT-PMP is enabled
	RandomPort                         bool                   `json:"random_port"`                           //True if the port is randomly selected
	DlLimit                            int                    `json:"dl_limit"`                              //Global download speed limit in KiB/s; -1 means no limit is applied
	UpLimit                            int                    `json:"up_limit"`                              //Global upload speed limit in KiB/s; -1 means no limit is applied
	MaxConnec                          int                    `json:"max_connec"`                            //Maximum global number of simultaneous connections
	MaxConnecPerTorrent                int                    `json:"max_connec_per_torrent"`                //Maximum number of simultaneous connections per torrent
	MaxUploads                         int                    `json:"max_uploads"`                           //Maximum number of upload slots
	MaxUploadsPerTorrent               int                    `json:"max_uploads_per_torrent"`               //Maximum number of upload slots per torrent
	StopTrackerTimeout                 int                    `json:"stop_tracker_timeout"`                  //Timeout in seconds for a stopped announce request to trackers
	EnablePieceExtentAffinity          bool                   `json:"enable_piece_extent_affinity"`          //True if the advanced libtorrent option piece_extent_affinity is enabled
	BittorrentProtocol                 int                    `json:"bittorrent_protocol"`                   //Bittorrent Protocol to use (see list of possible values below)
	LimitUtpRate                       bool                   `json:"limit_utp_rate"`                        //True if [du]l_limit should be applied to uTP connections; this option is only available in qBittorent built against libtorrent version 0.16.X and higher
	LimitTcpOverhead                   bool                   `json:"limit_tcp_overhead"`                    //True if [du]l_limit should be applied to estimated TCP overhead (service data: e.g. packet headers)
	LimitLanPeers                      bool                   `json:"limit_lan_peers"`                       //True if [du]l_limit should be applied to peers on the LAN
	AltDlLimit                         int                    `json:"alt_dl_limit"`                          //Alternative global download speed limit in KiB/s
	AltUpLimit                         int                    `json:"alt_up_limit"`                          //Alternative global upload speed limit in KiB/s
	SchedulerEnabled                   bool                   `json:"scheduler_enabled"`                     //True if alternative limits should be applied according to schedule
	ScheduleFromHour                   int                    `json:"schedule_from_hour"`                    //Scheduler starting hour
	ScheduleFromMin                    int                    `json:"schedule_from_min"`                     //Scheduler starting minute
	ScheduleToHour                     int                    `json:"schedule_to_hour"`                      //Scheduler ending hour
	ScheduleToMin                      int                    `json:"schedule_to_min"`                       //Scheduler ending minute
	SchedulerDays                      int                    `json:"scheduler_days"`                        //Scheduler days. See possible values here below
	Dht                                bool                   `json:"dht"`                                   //True if DHT is enabled
	Pex                                bool                   `json:"pex"`                                   //True if PeX is enabled
	Lsd                                bool                   `json:"lsd"`                                   //True if LSD is enabled
	Encryption                         int                    `json:"encryption"`                            //See list of possible values here below
	AnonymousMode                      bool                   `json:"anonymous_mode"`                        //If true anonymous mode will be enabled; read more here; this option is only available in qBittorent built against libtorrent version 0.16.X and higher
	ProxyType                          int                    `json:"proxy_type"`                            //See list of possible values here below
	ProxyIp                            string                 `json:"proxy_ip"`                              //Proxy IP address or domain name
	ProxyPort                          int                    `json:"proxy_port"`                            //Proxy port
	ProxyPeerConnections               bool                   `json:"proxy_peer_connections"`                //True if peer and web seed connections should be proxified; this option will have any effect only in qBittorent built against libtorrent version 0.16.X and higher
	ProxyAuthEnabled                   bool                   `json:"proxy_auth_enabled"`                    //True proxy requires authentication; doesn't apply to SOCKS4 proxies
	ProxyUsername                      string                 `json:"proxy_username"`                        //Username for proxy authentication
	ProxyPassword                      string                 `json:"proxy_password"`                        //Password for proxy authentication
	ProxyTorrentsOnly                  bool                   `json:"proxy_torrents_only"`                   //True if proxy is only used for torrents
	IpFilterEnabled                    bool                   `json:"ip_filter_enabled"`                     //True if external IP filter should be enabled
	IpFilterPath                       string                 `json:"ip_filter_path"`                        //Path to IP filter file (.dat, .p2p, .p2b files are supported); path is separated by slashes
	IpFilterTrackers                   bool                   `json:"ip_filter_trackers"`                    //True if IP filters are applied to trackers
	WebUiDomainList                    string                 `json:"web_ui_domain_list"`                    //Comma-separated list of domains to accept when performing Host header validation
	WebUiAddress                       string                 `json:"web_ui_address"`                        //IP address to use for the WebUI
	WebUiPort                          int                    `json:"web_ui_port"`                           //WebUI port
	WebUiUpnp                          bool                   `json:"web_ui_upnp"`                           //True if UPnP is used for the WebUI port
	WebUiUsername                      string                 `json:"web_ui_username"`                       //WebUI username
	WebUiPassword                      string                 `json:"web_ui_password"`                       //For API ≥ v2.3.0: Plaintext WebUI password, not readable, write-only. For API < v2.3.0: MD5 hash of WebUI password, hash is generated from the following string: username:Web UI Access:plain_text_web_ui_password
	WebUiCsrfProtectionEnabled         bool                   `json:"web_ui_csrf_protection_enabled"`        //True if WebUI CSRF protection is enabled
	WebUiClickjackingProtectionEnabled bool                   `json:"web_ui_clickjacking_protection_enable"` //True if WebUI clickjacking protection is enabled
	WebUiSecureCookieEnabled           bool                   `json:"web_ui_secure_cookie_enabled"`          //True if WebUI cookie Secure flag is enabled
	WebUiMaxAuthFailCount              int                    `json:"web_ui_max_auth_fail_count"`            //Maximum number of authentication failures before WebUI access ban
	WebUiBanDuration                   int                    `json:"web_ui_ban_duration"`                   //WebUI access ban duration in seconds
	WebUiSessionTimeout                int                    `json:"web_ui_session_timeout"`                //Seconds until WebUI is automatically signed off
	WebUiHostHeaderValidationEnabled   bool                   `json:"web_ui_host_header_validation_enabled"` //True if WebUI host header validation is enabled
	BypassLocalAuth                    bool                   `json:"bypass_local_auth"`                     //True if authentication challenge for loopback address (127.0.0.1) should be disabled
	BypassAuthSubnetWhitelistEnabled   bool                   `json:"bypass_auth_subnet_whitelist_enabled"`  //True if webui authentication should be bypassed for clients whose ip resides within (at least) one of the subnets on the whitelist
	BypassAuthSubnetWhitelist          string                 `json:"bypass_auth_subnet_whitelist"`          //(White)list of ipv4/ipv6 subnets for which webui authentication should be bypassed; list entries are separated by commas
	AlternativeWebuiEnabled            bool                   `json:"alternative_webui_enabled"`             //True if an alternative WebUI should be used
	AlternativeWebuiPath               string                 `json:"alternative_webui_path"`                //File path to the alternative WebUI
	UseHttps                           bool                   `json:"use_https"`                             //True if WebUI HTTPS access is enabled
	SslKey                             string                 `json:"ssl_key"`                               //For API < v2.0.1: SSL keyfile contents (this is a not a path)
	SslCert                            string                 `json:"ssl_cert"`                              //For API < v2.0.1: SSL certificate contents (this is a not a path)
	WebUiHttpsKeyPath                  string                 `json:"web_ui_https_key_path"`                 //For API ≥ v2.0.1: Path to SSL keyfile
	WebUiHttpsCertPath                 string                 `json:"web_ui_https_cert_path"`                //For API ≥ v2.0.1: Path to SSL certificate
	DyndnsEnabled                      bool                   `json:"dyndns_enabled"`                        //True if server DNS should be updated dynamically
	DyndnsService                      int                    `json:"dyndns_service"`                        //See list of possible values here below
	DyndnsUsername                     string                 `json:"dyndns_username"`                       //Username for DDNS service
	DyndnsPassword                     string                 `json:"dyndns_password"`                       //Password for DDNS service
	DyndnsDomain                       string                 `json:"dyndns_domain"`                         //Your DDNS domain name
	RssRefreshInterval                 int                    `json:"rss_refresh_interval"`                  //RSS refresh interval
	RssMaxArticlesPerFeed              int                    `json:"rss_max_articles_per_feed"`             //Max stored articles per RSS feed
	RssProcessingEnabled               bool                   `json:"rss_processing_enabled"`                //Enable processing of RSS feeds
	RssAutoDownloadingEnabled          bool                   `json:"rss_auto_downloading_enabled"`          //Enable auto-downloading of torrents from the RSS feeds
	RssDownloadRepackProperEpisodes    bool                   `json:"rss_download_repack_proper_episodes"`   //For API ≥ v2.5.1: Enable downloading of repack/proper Episodes
	RssSmartEpisodeFilters             string                 `json:"rss_smart_episode_filters"`             //For API ≥ v2.5.1: List of RSS Smart Episode Filters
	AddTrackersEnabled                 bool                   `json:"add_trackers_enabled"`                  //Enable automatic adding of trackers to new torrents
	AddTrackers                        string                 `json:"add_trackers"`                          //List of trackers to add to new torrent
	WebUiUseCustomHttpHeadersEnabled   bool                   `json:"web_ui_use_custom_http_headers_enable"` //For API ≥ v2.5.1: Enable custom http headers
	WebUiCustomHttpHeaders             string                 `json:"web_ui_custom_http_headers"`            //For API ≥ v2.5.1: List of custom http headers
	MaxSeedingTimeEnabled              bool                   `json:"max_seeding_time_enabled"`              //True enables max seeding time
	MaxSeedingTime                     int                    `json:"max_seeding_time"`                      //Number of minutes to seed a torrent
	AnnounceIp                         string                 `json:"announce_ip"`                           //TODO
	AnnounceToAllTiers                 bool                   `json:"announce_to_all_tiers"`                 //True always announce to all tiers
	AnnounceToAllTrackers              bool                   `json:"announce_to_all_trackers"`              //True always announce to all trackers in a tier
	AsyncIoThreads                     int                    `json:"async_io_threads"`                      //Number of asynchronous I/O threads
	BannedIps                          string                 `json:"banned_IPs"`                            //List of banned IPs
	CheckingMemoryUse                  int                    `json:"checking_memory_use"`                   //Outstanding memory when checking torrents in MiB
	CurrentInterfaceAddress            string                 `json:"current_interface_address"`             //IP Address to bind to. Empty String means All addresses
	CurrentNetworkInterface            string                 `json:"current_network_interface"`             //Network Interface used
	DiskCache                          int                    `json:"disk_cache"`                            //Disk cache used in MiB
	DiskCacheTtl                       int                    `json:"disk_cache_ttl"`                        //Disk cache expiry interval in seconds
	EmbeddedTrackerPort                int                    `json:"embedded_tracker_port"`                 //Port used for embedded tracker
	EnableCoalesceReadWrite            bool                   `json:"enable_coalesce_read_write"`            //True enables coalesce reads & writes
	EnableEmbeddedTracker              bool                   `json:"enable_embedded_tracker"`               //True enables embedded tracker
	EnableMultiConnectionsFromSameIp   bool                   `json:"enable_multi_connections_from_same_ip"` //True allows multiple connections from the same IP address
	EnableOsCache                      bool                   `json:"enable_os_cache"`                       //True enables os cache
	EnableUploadSuggestions            bool                   `json:"enable_upload_suggestions"`             //True enables sending of upload piece suggestions
	FilePoolSize                       int                    `json:"file_pool_size"`                        //File pool size
	OutgoingPortsMax                   int                    `json:"outgoing_ports_max"`                    //Maximal outgoing port (0: Disabled)
	OutgoingPortsMin                   int                    `json:"outgoing_ports_min"`                    //Minimal outgoing port (0: Disabled)
	RecheckCompletedTorrents           bool                   `json:"recheck_completed_torrents"`            //True rechecks torrents on completion
	ResolvePeerCountries               bool                   `json:"resolve_peer_countries"`                //True resolves peer countries
	SaveResumeDataInterval             int                    `json:"save_resume_data_interval"`             //Save resume data interval in min
	SendBufferLowWatermark             int                    `json:"send_buffer_low_watermark"`             //Send buffer low watermark in KiB
	SendBufferWatermark                int                    `json:"send_buffer_watermark"`                 //Send buffer watermark in KiB
	SendBufferWatermarkFactor          int                    `json:"send_buffer_watermark_factor"`          //Send buffer watermark factor in percent
	SocketBacklogSize                  int                    `json:"socket_backlog_size"`                   //Socket backlog size
	UploadChokingAlgorithm             int                    `json:"upload_choking_algorithm"`              //Upload choking algorithm used (see list of possible values below)
	UploadSlotsBehavior                int                    `json:"upload_slots_behavior"`                 //Upload slots behavior used (see list of possible values below)
	UpnpLeaseDuration                  int                    `json:"upnp_lease_duration"`                   //UPnP lease duration (0: Permanent lease)
	UtpTcpMixedMode                    int                    `json:"utp_tcp_mixed_mode"`
}

type GetApplicationVersionReq

type GetApplicationVersionReq struct {
}

type GetApplicationVersionRsp

type GetApplicationVersionRsp struct {
	Version string
}

type GetBuildInfoReq

type GetBuildInfoReq struct{}

type GetBuildInfoRsp

type GetBuildInfoRsp struct {
	Info *BuildInfo
}

type GetDefaultSavePathReq

type GetDefaultSavePathReq struct {
}

type GetDefaultSavePathRsp

type GetDefaultSavePathRsp struct {
	Path string
}

type GetGlobalDownloadLimitReq

type GetGlobalDownloadLimitReq struct {
}

type GetGlobalDownloadLimitRsp

type GetGlobalDownloadLimitRsp struct {
	Speed int
}

type GetGlobalTransferInfoReq

type GetGlobalTransferInfoReq struct {
}

type GetGlobalTransferInfoRsp

type GetGlobalTransferInfoRsp struct {
	Info *GlobalTransferInfo
}

type GetGlobalUploadLimitReq

type GetGlobalUploadLimitReq struct {
}

type GetGlobalUploadLimitRsp

type GetGlobalUploadLimitRsp struct {
	Speed int
}

type GetLogReq

type GetLogReq struct {
	Normal      bool `json:"normal"`
	Info        bool `json:"info"`
	Warning     bool `json:"warning"`
	Critical    bool `json:"critical"`
	LastKnownId int  `json:"last_known_id"`
}

type GetLogRsp

type GetLogRsp struct {
	Items []*LogItem
}

type GetMainDataReq

type GetMainDataReq struct {
	Rid int `json:"rid"`
}

type GetMainDataRsp

type GetMainDataRsp struct {
	Rid               int                         `json:"rid"`                //Response ID
	FullUpdate        bool                        `json:"full_update"`        //Whether the response contains all the data or partial data
	Torrents          map[string]*TorrentListItem `json:"torrents"`           //Property: torrent hash, value: same as torrent list
	TorrentsRemoved   []interface{}               `json:"torrents_removed"`   //List of hashes of torrents removed since last request
	Categories        map[string]interface{}      `json:"categories"`         //Info for categories added since last request
	CategoriesRemoved []interface{}               `json:"categories_removed"` //List of categories removed since last request
	Tags              []interface{}               `json:"tags"`               //List of tags added since last request
	TagsRemoved       []interface{}               `json:"tags_removed"`       //List of tags removed since last request
	ServerState       *GlobalTransferInfo         `json:"server_state"`       //Global transfer info
}

type GetPeerLogReq

type GetPeerLogReq struct {
	LastKnownId int `json:"last_known_id"`
}

type GetPeerLogRsp

type GetPeerLogRsp struct {
	Items []*PeerLogItem
}

type GetTorrentContentsReq

type GetTorrentContentsReq struct {
	Hash  string
	Index []string
}

type GetTorrentContentsRsp

type GetTorrentContentsRsp struct {
	Contents []*TorrentContentItem
}

type GetTorrentDownloadLimitReq

type GetTorrentDownloadLimitReq struct {
	IsGetAll bool
	Hash     []string
}

type GetTorrentDownloadLimitRsp

type GetTorrentDownloadLimitRsp struct {
	SpeedMap map[string]int //{hash:speed, ...}
}

type GetTorrentGenericPropertiesReq

type GetTorrentGenericPropertiesReq struct {
	Hash string `json:"hash"`
}

type GetTorrentGenericPropertiesRsp

type GetTorrentGenericPropertiesRsp struct {
	Property *TorrentGenericProperty
}

type GetTorrentListReq

type GetTorrentListReq struct {
	Filter   *string `json:"filter,omitempty"`
	Category *string `json:"category,omitempty"`
	Tag      *string `json:"tag,omitempty"`
	Sort     *string `json:"sort,omitempty"`
	Reverse  *bool   `json:"reverse,omitempty"`
	Limit    *int    `json:"limit,omitempty"`
	Offset   *int    `json:"offset,omitempty"`
	Hashes   *string `json:"hashes,omitempty"`
}

type GetTorrentListRsp

type GetTorrentListRsp struct {
	Items []*TorrentListItem
}

type GetTorrentPeerDataReq

type GetTorrentPeerDataReq struct {
	Hash string `json:"hash"`
	Rid  int    `json:"rid"`
}

type GetTorrentPeerDataRsp

type GetTorrentPeerDataRsp struct {
	Data *TorrentPeerData
}

type GetTorrentPiecesHashesReq

type GetTorrentPiecesHashesReq struct {
	Hash string `json:"hash"`
}

type GetTorrentPiecesHashesRsp

type GetTorrentPiecesHashesRsp struct {
	Hashes []string
}

type GetTorrentPiecesStatesReq

type GetTorrentPiecesStatesReq struct {
	Hash string `json:"hash"`
}

type GetTorrentPiecesStatesRsp

type GetTorrentPiecesStatesRsp struct {
	States []int
}

type GetTorrentTrackersReq

type GetTorrentTrackersReq struct {
	Hash string `json:"hash"`
}

type GetTorrentTrackersRsp

type GetTorrentTrackersRsp struct {
	Trackers []*TorrentTrackerItem
}

type GetTorrentUploadLimitReq

type GetTorrentUploadLimitReq struct {
	IsGetAll bool
	Hash     []string
}

type GetTorrentUploadLimitRsp

type GetTorrentUploadLimitRsp struct {
	SpeedMap map[string]int
}

type GetTorrentWebSeedsReq

type GetTorrentWebSeedsReq struct {
	Hash string `json:"hash"`
}

type GetTorrentWebSeedsRsp

type GetTorrentWebSeedsRsp struct {
	WebSeeds []*TorrentWebSeedItem
}

type GlobalTransferInfo

type GlobalTransferInfo struct {
	DlInfoSpeed      int    `json:"dl_info_speed"`     //Global download rate (bytes/s)
	DlInfoData       int    `json:"dl_info_data"`      //Data downloaded this session (bytes)
	UpInfoSpeed      int    `json:"up_info_speed"`     //Global upload rate (bytes/s)
	UpInfoData       int    `json:"up_info_data"`      //Data uploaded this session (bytes)
	DlRateLimit      int    `json:"dl_rate_limit"`     //Download rate limit (bytes/s)
	UpRateLimit      int    `json:"up_rate_limit"`     //Upload rate limit (bytes/s)
	DhtNodes         int    `json:"dht_nodes"`         //DHT nodes connected to
	ConnectionStatus string `json:"connection_status"` //Connection status. See possible values here below
}

type IncreaseTorrentPriorityReq

type IncreaseTorrentPriorityReq struct {
	IsIncreaseAllTorrent bool
	Hash                 []string
}

type IncreaseTorrentPriorityRsp

type IncreaseTorrentPriorityRsp struct {
}

type LogItem

type LogItem struct {
	Id        int    `json:"id"`
	Message   string `json:"message"`
	Timestamp int    `json:"timestamp"`
	Type      int    `json:"type"`
}

type LoginReq

type LoginReq struct {
	Username string `json:"username"`
	Password string `json:"password"`
}

type LoginRsp

type LoginRsp struct {
}

type MaximalTorrentPriorityReq

type MaximalTorrentPriorityReq struct {
	IsMaximalAllTorrent bool
	Hash                []string
}

type MaximalTorrentPriorityRsp

type MaximalTorrentPriorityRsp struct {
}

type MinimalTorrentPriorityReq

type MinimalTorrentPriorityReq struct {
	IsMinimalAllTorrent bool
	Hash                []string
}

type MinimalTorrentPriorityRsp

type MinimalTorrentPriorityRsp struct {
}

type Option

type Option func(c *Config)

func WithAuth

func WithAuth(user string, pwd string) Option

func WithHost

func WithHost(host string) Option

func WithTimeout

func WithTimeout(duration time.Duration) Option

type PauseTorrentsReq

type PauseTorrentsReq struct {
	Hash []string
}

type PauseTorrentsRsp

type PauseTorrentsRsp struct {
}

type PeerLogItem

type PeerLogItem struct {
	Id        int    `json:"id"`
	Ip        string `json:"ip"`
	Timestamp int    `json:"timestamp"`
	Blocked   bool   `json:"blocked"`
	Reason    string `json:"reason"`
}

type QBAPI

type QBAPI struct {
	// contains filtered or unexported fields
}

func NewAPI

func NewAPI(opts ...Option) (*QBAPI, error)

func (*QBAPI) AddNewCategory

func (q *QBAPI) AddNewCategory(ctx context.Context, req *AddNewCategoryReq) (*AddNewCategoryRsp, error)

400 Category name is empty 409 Category name is invalid 200 All other scenarios

AddNewCategory /api/v2/torrents/createCategory

func (q *QBAPI) AddNewLink(ctx context.Context, req *AddNewLinkReq) (*AddNewLinkRsp, error)

AddNewLink /api/v2/torrents/add

func (*QBAPI) AddNewTorrent

func (q *QBAPI) AddNewTorrent(ctx context.Context, req *AddNewTorrentReq) (*AddNewTorrentRsp, error)

AddNewTorrent /api/v2/torrents/add

func (*QBAPI) AddPeers

func (q *QBAPI) AddPeers(ctx context.Context, req *AddPeersReq) (*AddPeersRsp, error)

400 None of the supplied peers are valid 200 All other scenarios

AddPeers /api/v2/torrents/addPeers

func (*QBAPI) AddTorrentTags

func (q *QBAPI) AddTorrentTags(ctx context.Context, req *AddTorrentTagsReq) (*AddTorrentTagsRsp, error)

AddTorrentTags /api/v2/torrents/addTags

func (*QBAPI) AddTrackersToTorrent

func (q *QBAPI) AddTrackersToTorrent(ctx context.Context, req *AddTrackersToTorrentReq) (*AddTrackersToTorrentRsp, error)

AddTrackersToTorrent /api/v2/torrents/addTrackers

func (*QBAPI) BanPeers

func (q *QBAPI) BanPeers(ctx context.Context, req *BanPeersReq) (*BanPeersRsp, error)

BanPeers /api/v2/transfer/banPeers

func (*QBAPI) CreateTags

func (q *QBAPI) CreateTags(ctx context.Context, req *CreateTagsReq) (*CreateTagsRsp, error)

CreateTags /api/v2/torrents/createTags

func (*QBAPI) DecreaseTorrentPriority

func (q *QBAPI) DecreaseTorrentPriority(ctx context.Context, req *DecreaseTorrentPriorityReq) (*DecreaseTorrentPriorityRsp, error)

409 Torrent queueing is not enabled 200 All other scenarios

DecreaseTorrentPriority /api/v2/torrents/decreasePrio

func (*QBAPI) DeleteTags

func (q *QBAPI) DeleteTags(ctx context.Context, req *DeleteTagsReq) (*DeleteTagsRsp, error)

DeleteTags /api/v2/torrents/deleteTags

func (*QBAPI) DeleteTorrents

func (q *QBAPI) DeleteTorrents(ctx context.Context, req *DeleteTorrentsReq) (*DeleteTorrentsRsp, error)

DeleteTorrents /api/v2/torrents/delete

func (*QBAPI) EditCategory

func (q *QBAPI) EditCategory(ctx context.Context, req *EditCategoryReq) (*EditCategoryRsp, error)

400 Category name is empty 409 Category editing failed 200 All other scenarios

EditCategory /api/v2/torrents/editCategory

func (*QBAPI) EditTrackers

func (q *QBAPI) EditTrackers(ctx context.Context, req *EditTrackersReq) (*EditTrackersRsp, error)

400 newUrl is not a valid URL 404 Torrent hash was not found 409 newUrl already exists for the torrent 409 origUrl was not found 200 All other scenarios

EditTrackers /api/v2/torrents/editTracker

func (*QBAPI) GetAPIVersion

func (q *QBAPI) GetAPIVersion(ctx context.Context, req *GetAPIVersionReq) (*GetAPIVersionRsp, error)

GetAPIVersion /api/v2/app/webapiVersion

func (*QBAPI) GetAllCategories

func (q *QBAPI) GetAllCategories(ctx context.Context, req *GetAllCategoriesReq) (*GetAllCategoriesRsp, error)

GetAllCategories /api/v2/torrents/categories

func (*QBAPI) GetAllTags

func (q *QBAPI) GetAllTags(ctx context.Context, req *GetAllTagsReq) (*GetAllTagsRsp, error)

GetAllTags /api/v2/torrents/tags

func (*QBAPI) GetAlternativeSpeedLimitsState

func (q *QBAPI) GetAlternativeSpeedLimitsState(ctx context.Context, req *GetAlternativeSpeedLimitsStateReq) (*GetAlternativeSpeedLimitsStateRsp, error)

GetAlternativeSpeedLimitsState /api/v2/transfer/speedLimitsMode

func (*QBAPI) GetApplicationPreferences

func (q *QBAPI) GetApplicationPreferences(ctx context.Context, req *GetApplicationPreferencesReq) (*GetApplicationPreferencesRsp, error)

GetApplicationPreferences /api/v2/app/preferences

func (*QBAPI) GetApplicationVersion

func (q *QBAPI) GetApplicationVersion(ctx context.Context, req *GetApplicationVersionReq) (*GetApplicationVersionRsp, error)

GetApplicationVersion /api/v2/app/version

func (*QBAPI) GetBuildInfo

func (q *QBAPI) GetBuildInfo(ctx context.Context, req *GetBuildInfoReq) (*GetBuildInfoRsp, error)

GetBuildInfo /api/v2/app/buildInfo

func (*QBAPI) GetDefaultSavePath

func (q *QBAPI) GetDefaultSavePath(ctx context.Context, req *GetDefaultSavePathReq) (*GetDefaultSavePathRsp, error)

GetDefaultSavePath /api/v2/app/defaultSavePath

func (*QBAPI) GetGlobalDownloadLimit

func (q *QBAPI) GetGlobalDownloadLimit(ctx context.Context, req *GetGlobalDownloadLimitReq) (*GetGlobalDownloadLimitRsp, error)

GetGlobalDownloadLimit /api/v2/transfer/downloadLimit

func (*QBAPI) GetGlobalTransferInfo

func (q *QBAPI) GetGlobalTransferInfo(ctx context.Context, req *GetGlobalTransferInfoReq) (*GetGlobalTransferInfoRsp, error)

GetGlobalTransferInfo /api/v2/transfer/info

func (*QBAPI) GetGlobalUploadLimit

func (q *QBAPI) GetGlobalUploadLimit(ctx context.Context, req *GetGlobalUploadLimitReq) (*GetGlobalUploadLimitRsp, error)

GetGlobalUploadLimit /api/v2/transfer/uploadLimit

func (*QBAPI) GetLog

func (q *QBAPI) GetLog(ctx context.Context, req *GetLogReq) (*GetLogRsp, error)

GetLog /api/v2/log/main

func (*QBAPI) GetMainData

func (q *QBAPI) GetMainData(ctx context.Context, req *GetMainDataReq) (*GetMainDataRsp, error)

GetMainData /api/v2/sync/maindata

func (*QBAPI) GetPeerLog

func (q *QBAPI) GetPeerLog(ctx context.Context, req *GetPeerLogReq) (*GetPeerLogRsp, error)

GetPeerLog /api/v2/log/peers

func (*QBAPI) GetTorrentContents

func (q *QBAPI) GetTorrentContents(ctx context.Context, req *GetTorrentContentsReq) (*GetTorrentContentsRsp, error)

GetTorrentContents /api/v2/torrents/files

func (*QBAPI) GetTorrentDownloadLimit

func (q *QBAPI) GetTorrentDownloadLimit(ctx context.Context, req *GetTorrentDownloadLimitReq) (*GetTorrentDownloadLimitRsp, error)

GetTorrentDownloadLimit /api/v2/torrents/downloadLimit

func (*QBAPI) GetTorrentGenericProperties

func (q *QBAPI) GetTorrentGenericProperties(ctx context.Context, req *GetTorrentGenericPropertiesReq) (*GetTorrentGenericPropertiesRsp, error)

GetTorrentGenericProperties /api/v2/torrents/properties

func (*QBAPI) GetTorrentList

func (q *QBAPI) GetTorrentList(ctx context.Context, req *GetTorrentListReq) (*GetTorrentListRsp, error)

GetTorrentList /api/v2/torrents/info

func (*QBAPI) GetTorrentPeerData

func (q *QBAPI) GetTorrentPeerData(ctx context.Context, req *GetTorrentPeerDataReq) (*GetTorrentPeerDataRsp, error)

GetTorrentPeerData /api/v2/sync/torrentPeers

func (*QBAPI) GetTorrentPiecesHashes

func (q *QBAPI) GetTorrentPiecesHashes(ctx context.Context, req *GetTorrentPiecesHashesReq) (*GetTorrentPiecesHashesRsp, error)

GetTorrentPiecesHashes /api/v2/torrents/pieceHashes

func (*QBAPI) GetTorrentPiecesStates

func (q *QBAPI) GetTorrentPiecesStates(ctx context.Context, req *GetTorrentPiecesStatesReq) (*GetTorrentPiecesStatesRsp, error)

GetTorrentPiecesStates /api/v2/torrents/pieceStates

func (*QBAPI) GetTorrentTrackers

func (q *QBAPI) GetTorrentTrackers(ctx context.Context, req *GetTorrentTrackersReq) (*GetTorrentTrackersRsp, error)

GetTorrentTrackers /api/v2/torrents/trackers

func (*QBAPI) GetTorrentUploadLimit

func (q *QBAPI) GetTorrentUploadLimit(ctx context.Context, req *GetTorrentUploadLimitReq) (*GetTorrentUploadLimitRsp, error)

GetTorrentUploadLimit /api/v2/torrents/uploadLimit

func (*QBAPI) GetTorrentWebSeeds

func (q *QBAPI) GetTorrentWebSeeds(ctx context.Context, req *GetTorrentWebSeedsReq) (*GetTorrentWebSeedsRsp, error)

GetTorrentWebSeeds /api/v2/torrents/webseeds

func (*QBAPI) IncreaseTorrentPriority

func (q *QBAPI) IncreaseTorrentPriority(ctx context.Context, req *IncreaseTorrentPriorityReq) (*IncreaseTorrentPriorityRsp, error)

409 Torrent queueing is not enabled 200 All other scenarios

IncreaseTorrentPriority /api/v2/torrents/increasePrio

func (*QBAPI) Login

func (q *QBAPI) Login(ctx context.Context) error

Login /api/v2/auth/login

func (*QBAPI) MaximalTorrentPriority

func (q *QBAPI) MaximalTorrentPriority(ctx context.Context, req *MaximalTorrentPriorityReq) (*MaximalTorrentPriorityRsp, error)

MaximalTorrentPriority /api/v2/torrents/topPrio

func (*QBAPI) MinimalTorrentPriority

func (q *QBAPI) MinimalTorrentPriority(ctx context.Context, req *MinimalTorrentPriorityReq) (*MinimalTorrentPriorityRsp, error)

MinimalTorrentPriority /api/v2/torrents/bottomPrio

func (*QBAPI) PauseTorrents

func (q *QBAPI) PauseTorrents(ctx context.Context, req *PauseTorrentsReq) (*PauseTorrentsRsp, error)

PauseTorrents /api/v2/torrents/pause

func (*QBAPI) ReannounceTorrents

func (q *QBAPI) ReannounceTorrents(ctx context.Context, req *ReannounceTorrentsReq) (*ReannounceTorrentsRsp, error)

ReannounceTorrents /api/v2/torrents/reannounce

func (*QBAPI) RecheckTorrents

func (q *QBAPI) RecheckTorrents(ctx context.Context, req *RecheckTorrentsReq) (*RecheckTorrentsRsp, error)

RecheckTorrents /api/v2/torrents/recheck

func (*QBAPI) RemoveCategories

func (q *QBAPI) RemoveCategories(ctx context.Context, req *RemoveCategoriesReq) (*RemoveCategoriesRsp, error)

RemoveCategories /api/v2/torrents/removeCategories

func (*QBAPI) RemoveTorrentTags

func (q *QBAPI) RemoveTorrentTags(ctx context.Context, req *RemoveTorrentTagsReq) (*RemoveTorrentTagsRsp, error)

RemoveTorrentTags /api/v2/torrents/removeTags

func (*QBAPI) RemoveTrackers

func (q *QBAPI) RemoveTrackers(ctx context.Context, req *RemoveTrackersReq) (*RemoveTrackersRsp, error)

404 Torrent hash was not found 409 All urls were not found 200 All other scenarios

RemoveTrackers /api/v2/torrents/removeTrackers

func (*QBAPI) RenameFile

func (q *QBAPI) RenameFile(ctx context.Context, req *RenameFileReq) (*RenameFileRsp, error)

400 Missing newPath parameter 409 Invalid newPath or oldPath, or newPath already in use 200 All other scenarios

RenameFile /api/v2/torrents/renameFile

func (*QBAPI) RenameFolder

func (q *QBAPI) RenameFolder(ctx context.Context, req *RenameFolderReq) (*RenameFolderRsp, error)

RenameFolder /api/v2/torrents/renameFolder

func (*QBAPI) ResumeTorrents

func (q *QBAPI) ResumeTorrents(ctx context.Context, req *ResumeTorrentsReq) (*ResumeTorrentsRsp, error)

ResumeTorrents /api/v2/torrents/resume

func (*QBAPI) SetApplicationPreferences

func (q *QBAPI) SetApplicationPreferences(ctx context.Context, req *SetApplicationPreferencesReq) (*SetApplicationPreferencesRsp, error)

SetApplicationPreferences /api/v2/app/setPreferences

func (*QBAPI) SetAutomaticTorrentManagement

func (q *QBAPI) SetAutomaticTorrentManagement(ctx context.Context, req *SetAutomaticTorrentManagementReq) (*SetAutomaticTorrentManagementRsp, error)

SetAutomaticTorrentManagement /api/v2/torrents/setAutoManagement

func (*QBAPI) SetFilePriority

func (q *QBAPI) SetFilePriority(ctx context.Context, req *SetFilePriorityReq) (*SetFilePriorityRsp, error)

400 Priority is invalid 400 At least one file id is not a valid integer 404 Torrent hash was not found 409 Torrent metadata hasn't downloaded yet 409 At least one file id was not found 200 All other scenarios

SetFilePriority /api/v2/torrents/filePrio

func (*QBAPI) SetFirstOrLastPiecePriority

func (q *QBAPI) SetFirstOrLastPiecePriority(ctx context.Context, req *SetFirstOrLastPiecePriorityReq) (*SetFirstOrLastPiecePriorityRsp, error)

SetFirstOrLastPiecePriority /api/v2/torrents/toggleFirstLastPiecePrio

func (*QBAPI) SetForceStart

func (q *QBAPI) SetForceStart(ctx context.Context, req *SetForceStartReq) (*SetForceStartRsp, error)

SetForceStart /api/v2/torrents/setForceStart

func (*QBAPI) SetGlobalDownloadLimit

func (q *QBAPI) SetGlobalDownloadLimit(ctx context.Context, req *SetGlobalDownloadLimitReq) (*SetGlobalDownloadLimitRsp, error)

SetGlobalDownloadLimit /api/v2/transfer/setDownloadLimit

func (*QBAPI) SetGlobalUploadLimit

func (q *QBAPI) SetGlobalUploadLimit(ctx context.Context, req *SetGlobalUploadLimitReq) (*SetGlobalUploadLimitRsp, error)

SetGlobalUploadLimit /api/v2/transfer/setUploadLimit

func (*QBAPI) SetSuperSeeding

func (q *QBAPI) SetSuperSeeding(ctx context.Context, req *SetSuperSeedingReq) (*SetSuperSeedingRsp, error)

SetSuperSeeding /api/v2/torrents/setSuperSeeding

func (*QBAPI) SetTorrentCategory

func (q *QBAPI) SetTorrentCategory(ctx context.Context, req *SetTorrentCategoryReq) (*SetTorrentCategoryRsp, error)

409 Category name does not exist 200 All other scenarios

SetTorrentCategory /api/v2/torrents/setCategory

func (*QBAPI) SetTorrentDownloadLimit

func (q *QBAPI) SetTorrentDownloadLimit(ctx context.Context, req *SetTorrentDownloadLimitReq) (*SetTorrentDownloadLimitRsp, error)

SetTorrentDownloadLimit /api/v2/torrents/setDownloadLimit

func (*QBAPI) SetTorrentLocation

func (q *QBAPI) SetTorrentLocation(ctx context.Context, req *SetTorrentLocationReq) (*SetTorrentLocationRsp, error)

400 Save path is empty 403 User does not have write access to directory 409 Unable to create save path directory 200 All other scenarios

SetTorrentLocation /api/v2/torrents/setLocation

func (*QBAPI) SetTorrentName

func (q *QBAPI) SetTorrentName(ctx context.Context, req *SetTorrentNameReq) (*SetTorrentNameRsp, error)

404 Torrent hash is invalid 409 Torrent name is empty 200 All other scenarios

SetTorrentName /api/v2/torrents/rename

func (*QBAPI) SetTorrentShareLimit

func (q *QBAPI) SetTorrentShareLimit(ctx context.Context, req *SetTorrentShareLimitReq) (*SetTorrentShareLimitRsp, error)

SetTorrentShareLimit /api/v2/torrents/setShareLimits

func (*QBAPI) SetTorrentUploadLimit

func (q *QBAPI) SetTorrentUploadLimit(ctx context.Context, req *SetTorrentUploadLimitReq) (*SetTorrentUploadLimitRsp, error)

SetTorrentUploadLimit /api/v2/torrents/setUploadLimit

func (*QBAPI) ShutDownAPPlication

func (q *QBAPI) ShutDownAPPlication(ctx context.Context, req *ShutdownApplicationReq) (*ShutdownApplicationRsp, error)

ShutDownAPPlication /api/v2/app/shutdown

func (*QBAPI) ToggleAlternativeSpeedLimits

func (q *QBAPI) ToggleAlternativeSpeedLimits(ctx context.Context, req *ToggleAlternativeSpeedLimitsReq) (*ToggleAlternativeSpeedLimitsRsp, error)

ToggleAlternativeSpeedLimits /api/v2/transfer/toggleSpeedLimitsMode

func (*QBAPI) ToggleSequentialDownload

func (q *QBAPI) ToggleSequentialDownload(ctx context.Context, req *ToggleSequentialDownloadReq) (*ToggleSequentialDownloadRsp, error)

ToggleSequentialDownload /api/v2/torrents/toggleSequentialDownload

type QError

type QError struct {
	// contains filtered or unexported fields
}

func NewError

func NewError(code int, err error) *QError

func NewMsgError

func NewMsgError(code int, msg string) *QError

func (*QError) Code

func (q *QError) Code() int

func (*QError) Err

func (q *QError) Err() error

func (*QError) Error

func (q *QError) Error() string

func (*QError) RootCause

func (q *QError) RootCause() (int, error)

type ReannounceTorrentsReq

type ReannounceTorrentsReq struct {
	IsReannounceAll bool
	Hash            []string
}

type ReannounceTorrentsRsp

type ReannounceTorrentsRsp struct {
}

type RecheckTorrentsReq

type RecheckTorrentsReq struct {
	IsRecheckAll bool
	Hash         []string
}

type RecheckTorrentsRsp

type RecheckTorrentsRsp struct {
}

type RemoveCategoriesReq

type RemoveCategoriesReq struct {
	Category []string
}

type RemoveCategoriesRsp

type RemoveCategoriesRsp struct {
}

type RemoveTorrentTagsReq

type RemoveTorrentTagsReq struct {
	IsRemoveAll bool
	Hash        []string
	Tag         []string
}

type RemoveTorrentTagsRsp

type RemoveTorrentTagsRsp struct {
}

type RemoveTrackersReq

type RemoveTrackersReq struct {
	Hash string
	Url  []string
}

type RemoveTrackersRsp

type RemoveTrackersRsp struct {
}

type RenameFileReq

type RenameFileReq struct {
	Hash    string `json:"hash"`    //The hash of the torrent
	OldPath string `json:"oldPath"` //The old path of the torrent
	NewPath string `json:"newPath"` //The new path to use for the file
}

type RenameFileRsp

type RenameFileRsp struct {
}

type RenameFolderReq

type RenameFolderReq struct {
	Hash    string `json:"hash"`    //The hash of the torrent
	OldPath string `json:"oldPath"` //The old path of the torrent
	NewPath string `json:"newPath"` //The new path to use for the file
}

type RenameFolderRsp

type RenameFolderRsp struct {
}

type ResumeTorrentsReq

type ResumeTorrentsReq struct {
	Hash []string
}

type ResumeTorrentsRsp

type ResumeTorrentsRsp struct {
}

type SetApplicationPreferencesReq

type SetApplicationPreferencesReq struct {
	TorrentContentLayout               *string                `json:"torrent_content_layout,omitempty"`
	Locale                             *string                `json:"locale,omitempty"`
	CreateSubfolderEnabled             *bool                  `json:"create_subfolder_enabled,omitempty"`
	StartPausedEnabled                 *bool                  `json:"start_paused_enabled,omitempty"`
	AutoDeleteMode                     *int                   `json:"auto_delete_mode,omitempty"`
	PreallocateAll                     *bool                  `json:"preallocate_all,omitempty"`
	IncompleteFilesExt                 *bool                  `json:"incomplete_files_ext,omitempty"`
	AutoTmmEnabled                     *bool                  `json:"auto_tmm_enabled,omitempty"`                      //True if Automatic Torrent Management is enabled by default
	TorrentChangedTmmEnabled           *bool                  `json:"torrent_changed_tmm_enabled,omitempty"`           //True if torrent should be relocated when its Category changes
	SavePathChangedTmmEnabled          *bool                  `json:"save_path_changed_tmm_enabled,omitempty"`         //True if torrent should be relocated when the default save path changes
	CategoryChangedTmmEnabled          *bool                  `json:"category_changed_tmm_enabled,omitempty"`          //True if torrent should be relocated when its Category's save path changes
	SavePath                           *string                `json:"save_path,omitempty"`                             //Default save path for torrents, separated by slashes
	TempPathEnabled                    *bool                  `json:"temp_path_enabled,omitempty"`                     //True if folder for incomplete torrents is enabled
	TempPath                           *string                `json:"temp_path,omitempty"`                             //Path for incomplete torrents, separated by slashes
	ScanDirs                           map[string]interface{} `json:"scan_dirs,omitempty"`                             //Property: directory to watch for torrent files, value: where torrents loaded from this directory should be downloaded to (see list of possible values below). Slashes are used as path separators; multiple key/value pairs can be specified
	ExportDir                          *string                `json:"export_dir,omitempty"`                            //Path to directory to copy .torrent files to. Slashes are used as path separators
	ExportDirFin                       *string                `json:"export_dir_fin,omitempty"`                        //Path to directory to copy .torrent files of completed downloads to. Slashes are used as path separators
	MailNotificationEnabled            *bool                  `json:"mail_notification_enabled,omitempty"`             //True if e-mail notification should be enabled
	MailNotificationSender             *string                `json:"mail_notification_sender,omitempty"`              //e-mail where notifications should originate from
	MailNotificationEmail              *string                `json:"mail_notification_email,omitempty"`               //e-mail to send notifications to
	MailNotificationSmtp               *string                `json:"mail_notification_smtp,omitempty"`                //smtp server for e-mail notifications
	MailNotificationSslEnabled         *bool                  `json:"mail_notification_ssl_enabled,omitempty"`         //True if smtp server requires SSL connection
	MailNotificationAuthEnabled        *bool                  `json:"mail_notification_auth_enabled,omitempty"`        //True if smtp server requires authentication
	MailNotificationUsername           *string                `json:"mail_notification_username,omitempty"`            //Username for smtp authentication
	MailNotificationPassword           *string                `json:"mail_notification_password,omitempty"`            //Password for smtp authentication
	AutorunEnabled                     *bool                  `json:"autorun_enabled,omitempty"`                       //True if external program should be run after torrent has finished downloading
	AutorunProgram                     *string                `json:"autorun_program,omitempty"`                       //Program path/name/arguments to run if autorun_enabled is enabled; path is separated by slashes; you can use %f and %n arguments, which will be expanded by qBittorent as path_to_torrent_file and torrent_name (from the GUI; not the .torrent file name) respectively
	QueueingEnabled                    *bool                  `json:"queueing_enabled,omitempty"`                      //True if torrent queuing is enabled
	MaxActiveDownloads                 *int                   `json:"max_active_downloads,omitempty"`                  //Maximum number of active simultaneous downloads
	MaxActiveTorrents                  *int                   `json:"max_active_torrents,omitempty"`                   //Maximum number of active simultaneous downloads and uploads
	MaxActiveUploads                   *int                   `json:"max_active_uploads,omitempty"`                    //Maximum number of active simultaneous uploads
	DontCountSlowTorrents              *bool                  `json:"dont_count_slow_torrents,omitempty"`              //If true torrents w/o any activity (stalled ones) will not be counted towards max_active_* limits; see dont_count_slow_torrents for more information
	SlowTorrentDlRateThreshold         *int                   `json:"slow_torrent_dl_rate_threshold,omitempty"`        //Download rate in KiB/s for a torrent to be considered "slow"
	SlowTorrentUlRateThreshold         *int                   `json:"slow_torrent_ul_rate_threshold,omitempty"`        //Upload rate in KiB/s for a torrent to be considered "slow"
	SlowTorrentInactiveTimer           *int                   `json:"slow_torrent_inactive_timer,omitempty"`           //Seconds a torrent should be inactive before considered "slow"
	MaxRatioEnabled                    *bool                  `json:"max_ratio_enabled,omitempty"`                     //True if share ratio limit is enabled
	MaxRatio                           *float64               `json:"max_ratio,omitempty"`                             //Get the global share ratio limit
	MaxRatioAct                        *int                   `json:"max_ratio_act,omitempty"`                         //Action performed when a torrent reaches the maximum share ratio. See list of possible values here below.
	ListenPort                         *int                   `json:"listen_port,omitempty"`                           //Port for incoming connections
	Upnp                               *bool                  `json:"upnp,omitempty"`                                  //True if UPnP/NAT-PMP is enabled
	RandomPort                         *bool                  `json:"random_port,omitempty"`                           //True if the port is randomly selected
	DlLimit                            *int                   `json:"dl_limit,omitempty"`                              //Global download speed limit in KiB/s; -1 means no limit is applied
	UpLimit                            *int                   `json:"up_limit,omitempty"`                              //Global upload speed limit in KiB/s; -1 means no limit is applied
	MaxConnec                          *int                   `json:"max_connec,omitempty"`                            //Maximum global number of simultaneous connections
	MaxConnecPerTorrent                *int                   `json:"max_connec_per_torrent,omitempty"`                //Maximum number of simultaneous connections per torrent
	MaxUploads                         *int                   `json:"max_uploads,omitempty"`                           //Maximum number of upload slots
	MaxUploadsPerTorrent               *int                   `json:"max_uploads_per_torrent,omitempty"`               //Maximum number of upload slots per torrent
	StopTrackerTimeout                 *int                   `json:"stop_tracker_timeout,omitempty"`                  //Timeout in seconds for a stopped announce request to trackers
	EnablePieceExtentAffinity          *bool                  `json:"enable_piece_extent_affinity,omitempty"`          //True if the advanced libtorrent option piece_extent_affinity is enabled
	BittorrentProtocol                 *int                   `json:"bittorrent_protocol,omitempty"`                   //Bittorrent Protocol to use (see list of possible values below)
	LimitUtpRate                       *bool                  `json:"limit_utp_rate,omitempty"`                        //True if [du]l_limit should be applied to uTP connections; this option is only available in qBittorent built against libtorrent version 0.16.X and higher
	LimitTcpOverhead                   *bool                  `json:"limit_tcp_overhead,omitempty"`                    //True if [du]l_limit should be applied to estimated TCP overhead (service data: e.g. packet headers)
	LimitLanPeers                      *bool                  `json:"limit_lan_peers,omitempty"`                       //True if [du]l_limit should be applied to peers on the LAN
	AltDlLimit                         *int                   `json:"alt_dl_limit,omitempty"`                          //Alternative global download speed limit in KiB/s
	AltUpLimit                         *int                   `json:"alt_up_limit,omitempty"`                          //Alternative global upload speed limit in KiB/s
	SchedulerEnabled                   *bool                  `json:"scheduler_enabled,omitempty"`                     //True if alternative limits should be applied according to schedule
	ScheduleFromHour                   *int                   `json:"schedule_from_hour,omitempty"`                    //Scheduler starting hour
	ScheduleFromMin                    *int                   `json:"schedule_from_min,omitempty"`                     //Scheduler starting minute
	ScheduleToHour                     *int                   `json:"schedule_to_hour,omitempty"`                      //Scheduler ending hour
	ScheduleToMin                      *int                   `json:"schedule_to_min,omitempty"`                       //Scheduler ending minute
	SchedulerDays                      *int                   `json:"scheduler_days,omitempty"`                        //Scheduler days. See possible values here below
	Dht                                *bool                  `json:"dht,omitempty"`                                   //True if DHT is enabled
	Pex                                *bool                  `json:"pex,omitempty"`                                   //True if PeX is enabled
	Lsd                                *bool                  `json:"lsd,omitempty"`                                   //True if LSD is enabled
	Encryption                         *int                   `json:"encryption,omitempty"`                            //See list of possible values here below
	AnonymousMode                      *bool                  `json:"anonymous_mode,omitempty"`                        //If true anonymous mode will be enabled; read more here; this option is only available in qBittorent built against libtorrent version 0.16.X and higher
	ProxyType                          *int                   `json:"proxy_type,omitempty"`                            //See list of possible values here below
	ProxyIp                            *string                `json:"proxy_ip,omitempty"`                              //Proxy IP address or domain name
	ProxyPort                          *int                   `json:"proxy_port,omitempty"`                            //Proxy port
	ProxyPeerConnections               *bool                  `json:"proxy_peer_connections,omitempty"`                //True if peer and web seed connections should be proxified; this option will have any effect only in qBittorent built against libtorrent version 0.16.X and higher
	ProxyAuthEnabled                   *bool                  `json:"proxy_auth_enabled,omitempty"`                    //True proxy requires authentication; doesn't apply to SOCKS4 proxies
	ProxyUsername                      *string                `json:"proxy_username,omitempty"`                        //Username for proxy authentication
	ProxyPassword                      *string                `json:"proxy_password,omitempty"`                        //Password for proxy authentication
	ProxyTorrentsOnly                  *bool                  `json:"proxy_torrents_only,omitempty"`                   //True if proxy is only used for torrents
	IpFilterEnabled                    *bool                  `json:"ip_filter_enabled,omitempty"`                     //True if external IP filter should be enabled
	IpFilterPath                       *string                `json:"ip_filter_path,omitempty"`                        //Path to IP filter file (.dat, .p2p, .p2b files are supported); path is separated by slashes
	IpFilterTrackers                   *bool                  `json:"ip_filter_trackers,omitempty"`                    //True if IP filters are applied to trackers
	WebUiDomainList                    *string                `json:"web_ui_domain_list,omitempty"`                    //Comma-separated list of domains to accept when performing Host header validation
	WebUiAddress                       *string                `json:"web_ui_address,omitempty"`                        //IP address to use for the WebUI
	WebUiPort                          *int                   `json:"web_ui_port,omitempty"`                           //WebUI port
	WebUiUpnp                          *bool                  `json:"web_ui_upnp,omitempty"`                           //True if UPnP is used for the WebUI port
	WebUiUsername                      *string                `json:"web_ui_username,omitempty"`                       //WebUI username
	WebUiPassword                      *string                `json:"web_ui_password,omitempty"`                       //For API ≥ v2.3.0: Plaintext WebUI password, not readable, write-only. For API < v2.3.0: MD5 hash of WebUI password, hash is generated from the following string: username:Web UI Access:plain_text_web_ui_password
	WebUiCsrfProtectionEnabled         *bool                  `json:"web_ui_csrf_protection_enabled,omitempty"`        //True if WebUI CSRF protection is enabled
	WebUiClickjackingProtectionEnabled *bool                  `json:"web_ui_clickjacking_protection_enable,omitempty"` //True if WebUI clickjacking protection is enabled
	WebUiSecureCookieEnabled           *bool                  `json:"web_ui_secure_cookie_enabled,omitempty"`          //True if WebUI cookie Secure flag is enabled
	WebUiMaxAuthFailCount              *int                   `json:"web_ui_max_auth_fail_count,omitempty"`            //Maximum number of authentication failures before WebUI access ban
	WebUiBanDuration                   *int                   `json:"web_ui_ban_duration,omitempty"`                   //WebUI access ban duration in seconds
	WebUiSessionTimeout                *int                   `json:"web_ui_session_timeout,omitempty"`                //Seconds until WebUI is automatically signed off
	WebUiHostHeaderValidationEnabled   *bool                  `json:"web_ui_host_header_validation_enabled,omitempty"` //True if WebUI host header validation is enabled
	BypassLocalAuth                    *bool                  `json:"bypass_local_auth,omitempty"`                     //True if authentication challenge for loopback address (127.0.0.1) should be disabled
	BypassAuthSubnetWhitelistEnabled   *bool                  `json:"bypass_auth_subnet_whitelist_enabled,omitempty"`  //True if webui authentication should be bypassed for clients whose ip resides within (at least) one of the subnets on the whitelist
	BypassAuthSubnetWhitelist          *string                `json:"bypass_auth_subnet_whitelist,omitempty"`          //(White)list of ipv4/ipv6 subnets for which webui authentication should be bypassed; list entries are separated by commas
	AlternativeWebuiEnabled            *bool                  `json:"alternative_webui_enabled,omitempty"`             //True if an alternative WebUI should be used
	AlternativeWebuiPath               *string                `json:"alternative_webui_path,omitempty"`                //File path to the alternative WebUI
	UseHttps                           *bool                  `json:"use_https,omitempty"`                             //True if WebUI HTTPS access is enabled
	SslKey                             *string                `json:"ssl_key,omitempty"`                               //For API < v2.0.1: SSL keyfile contents (this is a not a path)
	SslCert                            *string                `json:"ssl_cert,omitempty"`                              //For API < v2.0.1: SSL certificate contents (this is a not a path)
	WebUiHttpsKeyPath                  *string                `json:"web_ui_https_key_path,omitempty"`                 //For API ≥ v2.0.1: Path to SSL keyfile
	WebUiHttpsCertPath                 *string                `json:"web_ui_https_cert_path,omitempty"`                //For API ≥ v2.0.1: Path to SSL certificate
	DyndnsEnabled                      *bool                  `json:"dyndns_enabled,omitempty"`                        //True if server DNS should be updated dynamically
	DyndnsService                      *int                   `json:"dyndns_service,omitempty"`                        //See list of possible values here below
	DyndnsUsername                     *string                `json:"dyndns_username,omitempty"`                       //Username for DDNS service
	DyndnsPassword                     *string                `json:"dyndns_password,omitempty"`                       //Password for DDNS service
	DyndnsDomain                       *string                `json:"dyndns_domain,omitempty"`                         //Your DDNS domain name
	RssRefreshInterval                 *int                   `json:"rss_refresh_interval,omitempty"`                  //RSS refresh interval
	RssMaxArticlesPerFeed              *int                   `json:"rss_max_articles_per_feed,omitempty"`             //Max stored articles per RSS feed
	RssProcessingEnabled               *bool                  `json:"rss_processing_enabled,omitempty"`                //Enable processing of RSS feeds
	RssAutoDownloadingEnabled          *bool                  `json:"rss_auto_downloading_enabled,omitempty"`          //Enable auto-downloading of torrents from the RSS feeds
	RssDownloadRepackProperEpisodes    *bool                  `json:"rss_download_repack_proper_episodes,omitempty"`   //For API ≥ v2.5.1: Enable downloading of repack/proper Episodes
	RssSmartEpisodeFilters             *string                `json:"rss_smart_episode_filters,omitempty"`             //For API ≥ v2.5.1: List of RSS Smart Episode Filters
	AddTrackersEnabled                 *bool                  `json:"add_trackers_enabled,omitempty"`                  //Enable automatic adding of trackers to new torrents
	AddTrackers                        *string                `json:"add_trackers,omitempty"`                          //List of trackers to add to new torrent
	WebUiUseCustomHttpHeadersEnabled   *bool                  `json:"web_ui_use_custom_http_headers_enable,omitempty"` //For API ≥ v2.5.1: Enable custom http headers
	WebUiCustomHttpHeaders             *string                `json:"web_ui_custom_http_headers,omitempty"`            //For API ≥ v2.5.1: List of custom http headers
	MaxSeedingTimeEnabled              *bool                  `json:"max_seeding_time_enabled,omitempty"`              //True enables max seeding time
	MaxSeedingTime                     *int                   `json:"max_seeding_time,omitempty"`                      //Number of minutes to seed a torrent
	AnnounceIp                         *string                `json:"announce_ip,omitempty"`                           //TODO
	AnnounceToAllTiers                 *bool                  `json:"announce_to_all_tiers,omitempty"`                 //True always announce to all tiers
	AnnounceToAllTrackers              *bool                  `json:"announce_to_all_trackers,omitempty"`              //True always announce to all trackers in a tier
	AsyncIoThreads                     *int                   `json:"async_io_threads,omitempty"`                      //Number of asynchronous I/O threads
	BannedIps                          *string                `json:"banned_IPs,omitempty"`                            //List of banned IPs
	CheckingMemoryUse                  *int                   `json:"checking_memory_use,omitempty"`                   //Outstanding memory when checking torrents in MiB
	CurrentInterfaceAddress            *string                `json:"current_interface_address,omitempty"`             //IP Address to bind to. Empty String means All addresses
	CurrentNetworkInterface            *string                `json:"current_network_interface,omitempty"`             //Network Interface used
	DiskCache                          *int                   `json:"disk_cache,omitempty"`                            //Disk cache used in MiB
	DiskCacheTtl                       *int                   `json:"disk_cache_ttl,omitempty"`                        //Disk cache expiry interval in seconds
	EmbeddedTrackerPort                *int                   `json:"embedded_tracker_port,omitempty"`                 //Port used for embedded tracker
	EnableCoalesceReadWrite            *bool                  `json:"enable_coalesce_read_write,omitempty"`            //True enables coalesce reads & writes
	EnableEmbeddedTracker              *bool                  `json:"enable_embedded_tracker,omitempty"`               //True enables embedded tracker
	EnableMultiConnectionsFromSameIp   *bool                  `json:"enable_multi_connections_from_same_ip,omitempty"` //True allows multiple connections from the same IP address
	EnableOsCache                      *bool                  `json:"enable_os_cache,omitempty"`                       //True enables os cache
	EnableUploadSuggestions            *bool                  `json:"enable_upload_suggestions,omitempty"`             //True enables sending of upload piece suggestions
	FilePoolSize                       *int                   `json:"file_pool_size,omitempty"`                        //File pool size
	OutgoingPortsMax                   *int                   `json:"outgoing_ports_max,omitempty"`                    //Maximal outgoing port (0: Disabled)
	OutgoingPortsMin                   *int                   `json:"outgoing_ports_min,omitempty"`                    //Minimal outgoing port (0: Disabled)
	RecheckCompletedTorrents           *bool                  `json:"recheck_completed_torrents,omitempty"`            //True rechecks torrents on completion
	ResolvePeerCountries               *bool                  `json:"resolve_peer_countries,omitempty"`                //True resolves peer countries
	SaveResumeDataInterval             *int                   `json:"save_resume_data_interval,omitempty"`             //Save resume data interval in min
	SendBufferLowWatermark             *int                   `json:"send_buffer_low_watermark,omitempty"`             //Send buffer low watermark in KiB
	SendBufferWatermark                *int                   `json:"send_buffer_watermark,omitempty"`                 //Send buffer watermark in KiB
	SendBufferWatermarkFactor          *int                   `json:"send_buffer_watermark_factor,omitempty"`          //Send buffer watermark factor in percent
	SocketBacklogSize                  *int                   `json:"socket_backlog_size,omitempty"`                   //Socket backlog size
	UploadChokingAlgorithm             *int                   `json:"upload_choking_algorithm,omitempty"`              //Upload choking algorithm used (see list of possible values below)
	UploadSlotsBehavior                *int                   `json:"upload_slots_behavior,omitempty"`                 //Upload slots behavior used (see list of possible values below)
	UpnpLeaseDuration                  *int                   `json:"upnp_lease_duration,omitempty"`                   //UPnP lease duration (0: Permanent lease)
	UtpTcpMixedMode                    *int                   `json:"utp_tcp_mixed_mode,omitempty"`
}

type SetApplicationPreferencesRsp

type SetApplicationPreferencesRsp struct {
}

type SetAutomaticTorrentManagementReq

type SetAutomaticTorrentManagementReq struct {
	IsSetAll bool
	Hash     []string
	Enable   bool
}

type SetAutomaticTorrentManagementRsp

type SetAutomaticTorrentManagementRsp struct {
}

type SetFilePriorityReq

type SetFilePriorityReq struct {
	Hash     string
	Id       []string
	Priority FilePriority
}

type SetFilePriorityRsp

type SetFilePriorityRsp struct {
}

type SetFirstOrLastPiecePriorityReq

type SetFirstOrLastPiecePriorityReq struct {
	IsSetAll bool
	Hash     []string
}

type SetFirstOrLastPiecePriorityRsp

type SetFirstOrLastPiecePriorityRsp struct {
}

type SetForceStartReq

type SetForceStartReq struct {
	IsSetAll bool
	Hash     []string
	Value    bool
}

type SetForceStartRsp

type SetForceStartRsp struct {
}

type SetGlobalDownloadLimitReq

type SetGlobalDownloadLimitReq struct {
	Speed int `json:"limit"`
}

type SetGlobalDownloadLimitRsp

type SetGlobalDownloadLimitRsp struct {
}

type SetGlobalUploadLimitReq

type SetGlobalUploadLimitReq struct {
	Speed int `json:"limit"`
}

type SetGlobalUploadLimitRsp

type SetGlobalUploadLimitRsp struct {
}

type SetSuperSeedingReq

type SetSuperSeedingReq struct {
	IsSetAll bool
	Hash     []string
	Value    bool
}

type SetSuperSeedingRsp

type SetSuperSeedingRsp struct {
}

type SetTorrentCategoryReq

type SetTorrentCategoryReq struct {
	IsSetAll bool
	Hash     []string
	Category string
}

type SetTorrentCategoryRsp

type SetTorrentCategoryRsp struct {
}

type SetTorrentDownloadLimitReq

type SetTorrentDownloadLimitReq struct {
	IsSetAll bool
	Hash     []string
	Speed    int
}

type SetTorrentDownloadLimitRsp

type SetTorrentDownloadLimitRsp struct {
}

type SetTorrentLocationReq

type SetTorrentLocationReq struct {
	IsSetAll bool
	Hash     []string
	Location string
}

type SetTorrentLocationRsp

type SetTorrentLocationRsp struct {
}

type SetTorrentNameReq

type SetTorrentNameReq struct {
	Hash string `json:"hash"`
	Name string `json:"name"`
}

type SetTorrentNameRsp

type SetTorrentNameRsp struct {
}

type SetTorrentShareLimitReq

type SetTorrentShareLimitReq struct {
	IsSetAll         bool
	Hash             []string
	SeedingTimeLimit int
	RatioLimit       float64
}

type SetTorrentShareLimitRsp

type SetTorrentShareLimitRsp struct {
}

type SetTorrentUploadLimitReq

type SetTorrentUploadLimitReq struct {
	IsSetAll bool
	Hash     []string
	Speed    int
}

type SetTorrentUploadLimitRsp

type SetTorrentUploadLimitRsp struct {
}

type ShutdownApplicationReq

type ShutdownApplicationReq struct {
}

type ShutdownApplicationRsp

type ShutdownApplicationRsp struct {
}

type StatusCodeErr

type StatusCodeErr struct {
	// contains filtered or unexported fields
}

func NewStatusCodeErr

func NewStatusCodeErr(code int) *StatusCodeErr

func (*StatusCodeErr) Code

func (s *StatusCodeErr) Code() int

func (*StatusCodeErr) Error

func (s *StatusCodeErr) Error() string

type ToggleAlternativeSpeedLimitsReq

type ToggleAlternativeSpeedLimitsReq struct {
}

type ToggleAlternativeSpeedLimitsRsp

type ToggleAlternativeSpeedLimitsRsp struct {
}

type ToggleSequentialDownloadReq

type ToggleSequentialDownloadReq struct {
	IsSetAll bool
	Hash     []string
}

type ToggleSequentialDownloadRsp

type ToggleSequentialDownloadRsp struct {
}

type TorrentContentItem

type TorrentContentItem struct {
	Index        int     `json:"index"`        //File index
	Name         string  `json:"name"`         //File name (including relative path)
	Size         int     `json:"size"`         //File size (bytes)
	Progress     float64 `json:"progress"`     //File progress (percentage/100)
	Priority     int     `json:"priority"`     //File priority. See possible values here below
	IsSeed       bool    `json:"is_seed"`      //True if file is seeding/complete
	PieceRange   []int   `json:"piece_range"`  //The first number is the starting piece index and the second number is the ending piece index (inclusive)
	Availability float64 `json:"availability"` //Percentage of file pieces currently available (percentage/100)

}

type TorrentGenericProperty

type TorrentGenericProperty struct {
	SavePath               string  `json:"save_path"`                //Torrent save path
	CreationDate           int     `json:"creation_date"`            //Torrent creation date (Unix timestamp)
	PieceSize              int     `json:"piece_size"`               //Torrent piece size (bytes)
	Comment                string  `json:"comment"`                  //Torrent comment
	TotalWasted            int     `json:"total_wasted"`             //Total data wasted for torrent (bytes)
	TotalUploaded          int     `json:"total_uploaded"`           //Total data uploaded for torrent (bytes)
	TotalUploadedSession   int     `json:"total_uploaded_session"`   //Total data uploaded this session (bytes)
	TotalDownloaded        int     `json:"total_downloaded"`         //Total data downloaded for torrent (bytes)
	TotalDownloadedSession int     `json:"total_downloaded_session"` //Total data downloaded this session (bytes)
	UpLimit                int     `json:"up_limit"`                 //Torrent upload limit (bytes/s)
	DlLimit                int     `json:"dl_limit"`                 //Torrent download limit (bytes/s)
	TimeElapsed            int     `json:"time_elapsed"`             //Torrent elapsed time (seconds)
	SeedingTime            int     `json:"seeding_time"`             //Torrent elapsed time while complete (seconds)
	NbConnections          int     `json:"nb_connections"`           //Torrent connection count
	NbConnectionsLimit     int     `json:"nb_connections_limit"`     //Torrent connection count limit
	ShareRatio             float64 `json:"share_ratio"`              //Torrent share ratio
	AdditionDate           int     `json:"addition_date"`            //When this torrent was added (unix timestamp)
	CompletionDate         int     `json:"completion_date"`          //Torrent completion date (unix timestamp)
	CreatedBy              string  `json:"created_by"`               //Torrent creator
	DlSpeedAvg             int     `json:"dl_speed_avg"`             //Torrent average download speed (bytes/second)
	DlSpeed                int     `json:"dl_speed"`                 //Torrent download speed (bytes/second)
	Eta                    int     `json:"eta"`                      //Torrent ETA (seconds)
	LastSeen               int     `json:"last_seen"`                //Last seen complete date (unix timestamp)
	Peers                  int     `json:"peers"`                    //Number of peers connected to
	PeersTotal             int     `json:"peers_total"`              //Number of peers in the swarm
	PiecesHave             int     `json:"pieces_have"`              //Number of pieces owned
	PiecesNum              int     `json:"pieces_num"`               //Number of pieces of the torrent
	Reannounce             int     `json:"reannounce"`               //Number of seconds until the next announce
	Seeds                  int     `json:"seeds"`                    //Number of seeds connected to
	SeedsTotal             int     `json:"seeds_total"`              //Number of seeds in the swarm
	TotalSize              int     `json:"total_size"`               //Torrent total size (bytes)
	UpSpeedAvg             int     `json:"up_speed_avg"`             //Torrent average upload speed (bytes/second)
	UpSpeed                int     `json:"up_speed"`                 //Torrent upload speed (bytes/second)
}

type TorrentListItem

type TorrentListItem struct {
	AddedOn           int     `json:"added_on"`
	AmountLeft        int     `json:"amount_left"`
	AutoTmm           bool    `json:"auto_tmm"`
	Availability      float64 `json:"availability"`
	Category          string  `json:"category"`
	Completed         int     `json:"completed"`
	CompletionOn      int     `json:"completion_on"`
	ContentPath       string  `json:"content_path"`
	DlLimit           int     `json:"dl_limit"`
	Dlspeed           int     `json:"dlspeed"`
	Downloaded        int     `json:"downloaded"`
	DownloadedSession int     `json:"downloaded_session"`
	Eta               int     `json:"eta"`
	FLPiecePrio       bool    `json:"f_l_piece_prio"`
	ForceStart        bool    `json:"force_start"`
	Hash              string  `json:"hash"`
	LastActivity      int     `json:"last_activity"`
	MagnetUri         string  `json:"magnet_uri"`
	MaxRatio          float64 `json:"max_ratio"`
	MaxSeedingTime    int     `json:"max_seeding_time"`
	Name              string  `json:"name"`
	NumComplete       int     `json:"num_complete"`
	NumIncomplete     int     `json:"num_incomplete"`
	NumLeechs         int     `json:"num_leechs"`
	NumSeeds          int     `json:"num_seeds"`
	Priority          int     `json:"priority"`
	Progress          float64 `json:"progress"`
	Ratio             float64 `json:"ratio"`
	RatioLimit        float64 `json:"ratio_limit"`
	SavePath          string  `json:"save_path"`
	SeedingTime       int     `json:"seeding_time"`
	SeedingTimeLimit  int     `json:"seeding_time_limit"`
	SeenComplete      int     `json:"seen_complete"`
	SeqDl             bool    `json:"seq_dl"`
	Size              int     `json:"size"`
	State             string  `json:"state"`
	SuperSeeding      bool    `json:"super_seeding"`
	Tags              string  `json:"tags"`
	TimeActive        int     `json:"time_active"`
	TotalSize         int     `json:"total_size"`
	Tracker           string  `json:"tracker"`
	UpLimit           int     `json:"up_limit"`
	Uploaded          int     `json:"uploaded"`
	UploadedSession   int     `json:"uploaded_session"`
	Upspeed           int     `json:"upspeed"`
}

type TorrentPeerData

type TorrentPeerData struct {
	FullUpdate bool                        `json:"full_update"`
	Rid        int                         `json:"rid"`
	ShowFlags  bool                        `json:"show_flags"`
	Peers      map[string]*TorrentPeerItem `json:"peers"`
}

type TorrentPeerItem

type TorrentPeerItem struct {
	Client      string  `json:"client"`
	Connection  string  `json:"connection"`
	Country     string  `json:"country"`
	CountryCode string  `json:"country_code"`
	DlSpeed     int     `json:"dl_speed"`
	Downloaded  int     `json:"downloaded"`
	Files       string  `json:"files"`
	Flags       string  `json:"flags"`
	FlagsDesc   string  `json:"flags_desc"`
	Ip          string  `json:"ip"`
	Port        int     `json:"port"`
	Progress    float64 `json:"progress"`
	Relevance   float64 `json:"relevance"`
	UpSpeed     int     `json:"up_speed"`
	Uploaded    int     `json:"uploaded"`
}

type TorrentTrackerItem

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

Note: tier should be integer, but in some trackers, it returns empty string

type TorrentWebSeedItem

type TorrentWebSeedItem struct {
	Url string `json:"url"`
}

Jump to

Keyboard shortcuts

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