Documentation
¶
Overview ¶
Package qbit provides a few methods to interact with a qbittorrent installation. This package is in no way complete, and was written for a specific purpose. If you need more features, please open a PR or GitHub Issue with the request.
Index ¶
- Constants
- Variables
- type Category
- type Config
- type Qbit
- func (q *Qbit) GetCategories() (map[string]*Category, error)
- func (q *Qbit) GetCategoriesContext(ctx context.Context) (map[string]*Category, error)
- func (q *Qbit) GetXfers() ([]*Xfer, error)
- func (q *Qbit) GetXfersContext(ctx context.Context) ([]*Xfer, error)
- func (q *Qbit) SetTorrentCategory(category string, torrentHashes ...string) error
- func (q *Qbit) SetTorrentCategoryContext(ctx context.Context, category string, torrentHashes ...string) error
- type Xfer
Constants ¶
const (
DefaultTimeout = 1 * time.Minute
)
Package defaults.
Variables ¶
var (
ErrLoginFailed = fmt.Errorf("authentication failed")
)
Custom errors returned by this package.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
URL string `json:"url" toml:"url" xml:"url" yaml:"url"`
User string `json:"username" toml:"user" xml:"user" yaml:"user"`
Pass string `json:"password" toml:"pass" xml:"pass" yaml:"pass"`
HTTPPass string `json:"http_pass" toml:"http_pass" xml:"http_pass" yaml:"http_pass"`
HTTPUser string `json:"http_user" toml:"http_user" xml:"http_user" yaml:"http_user"`
Client *http.Client `json:"-" toml:"-" xml:"-" yaml:"-"`
}
Config is the input data needed to return a Qbit struct. This is setup to allow you to easily pass this data in from a config file.
type Qbit ¶
type Qbit struct {
// contains filtered or unexported fields
}
Qbit is what you get in return for passing in a valid Config to New().
func (*Qbit) GetCategories ¶
GetCategories returns all the categories in Qbit.
func (*Qbit) GetCategoriesContext ¶
GetCategoriesContext returns all the categories in Qbit.
func (*Qbit) GetXfersContext ¶
GetXfersContext returns data about all transfers/downloads in the Qbit client.
func (*Qbit) SetTorrentCategory ¶
SetTorrentCategory updates the category for 1 or more torrents.
type Xfer ¶
type Xfer 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"`
RootPath string `json:"root_path"`
SeedingTime int64 `json:"seeding_time"`
SeedingTimeLimit int64 `json:"seeding_time_limit"`
SeenComplete int64 `json:"seen_complete"`
SeqDl bool `json:"seq_dl"`
Size int64 `json:"size"`
State string `json:"state"`
SuperSeeding bool `json:"super_seeding"`
Tags string `json:"tags"`
TimeActive int64 `json:"time_active"`
TotalSize int64 `json:"total_size"`
Tracker string `json:"tracker"`
TrackersCount int `json:"trackers_count"`
UpLimit int64 `json:"up_limit"`
Uploaded int64 `json:"uploaded"`
UploadedSession int64 `json:"uploaded_session"`
Upspeed int64 `json:"upspeed"`
}
Xfer is a transfer from the torrents/info endpoint.