Documentation ¶
Index ¶
- Variables
- func HumanReadableSize(sizeInit int64) string
- type BtServerInterface
- type QBittorrentServer
- func (q *QBittorrentServer) AddTorrentByURL(ctx context.Context, torrentUrl string, torrent *torrentv1alpha1.Torrent) error
- func (q *QBittorrentServer) DeleteTorrent(ctx context.Context, hash string, keepFiles bool) error
- func (q *QBittorrentServer) GetAPIVersion(ctx context.Context) (string, error)
- func (q *QBittorrentServer) GetTorrent(ctx context.Context, hash string) (*Torrent, error)
- func (q *QBittorrentServer) GetTorrentStatus(ctx context.Context, hash string) (*torrentv1alpha1.TorrentStatus, error)
- func (q *QBittorrentServer) GetTorrents(ctx context.Context) ([]*Torrent, error)
- func (q *QBittorrentServer) Login(username string, password string) error
- func (q *QBittorrentServer) MoveTorrent(ctx context.Context, hash string, destination string) error
- func (q *QBittorrentServer) RenameTorrent(ctx context.Context, hash string, name string) error
- func (q *QBittorrentServer) ResumeTorrent(ctx context.Context, hash string) error
- func (q *QBittorrentServer) StopTorrent(ctx context.Context, hash string) error
- type Torrent
- type TorrentState
- type TransmissionServer
- func (s *TransmissionServer) AddTorrentByURL(ctx context.Context, torrentUrl string, torrent *torrentv1alpha1.Torrent) error
- func (s *TransmissionServer) DeleteTorrent(ctx context.Context, hash string, keepFiles bool) error
- func (s *TransmissionServer) GetAPIVersion(ctx context.Context) (string, error)
- func (s *TransmissionServer) GetTorrent(ctx context.Context, hash string) (*Torrent, error)
- func (s *TransmissionServer) GetTorrentStatus(ctx context.Context, hash string) (*torrentv1alpha1.TorrentStatus, error)
- func (s *TransmissionServer) GetTorrents(ctx context.Context) ([]*Torrent, error)
- func (s *TransmissionServer) Login(username string, password string) error
- func (s *TransmissionServer) MoveTorrent(ctx context.Context, hash string, destination string) error
- func (s *TransmissionServer) RenameTorrent(ctx context.Context, hash string, name string) error
- func (s *TransmissionServer) ResumeTorrent(ctx context.Context, hash string) error
- func (s *TransmissionServer) StopTorrent(ctx context.Context, hash string) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrTorrentNotFound = errors.New("torrent not found")
Functions ¶
func HumanReadableSize ¶
HumanReadableSize Convert a size in bytes to a human-readable size
Types ¶
type BtServerInterface ¶
type BtServerInterface interface { Login(username string, password string) error GetAPIVersion(ctx context.Context) (string, error) GetTorrents(ctx context.Context) ([]*Torrent, error) GetTorrent(ctx context.Context, hash string) (*Torrent, error) AddTorrentByURL(ctx context.Context, url string, torrent *torrentv1alpha1.Torrent) error StopTorrent(ctx context.Context, hash string) error ResumeTorrent(ctx context.Context, hash string) error DeleteTorrent(ctx context.Context, hash string, keepFiles bool) error RenameTorrent(ctx context.Context, hash string, name string) error MoveTorrent(ctx context.Context, hash string, destination string) error GetTorrentStatus(ctx context.Context, hash string) (*torrentv1alpha1.TorrentStatus, error) }
type QBittorrentServer ¶
type QBittorrentServer struct {
// contains filtered or unexported fields
}
func NewQBittorrentServer ¶
func NewQBittorrentServer(btServerSpec torrentv1alpha1.BtServerSpec) *QBittorrentServer
func (*QBittorrentServer) AddTorrentByURL ¶
func (q *QBittorrentServer) AddTorrentByURL(ctx context.Context, torrentUrl string, torrent *torrentv1alpha1.Torrent) error
func (*QBittorrentServer) DeleteTorrent ¶
func (*QBittorrentServer) GetAPIVersion ¶
func (q *QBittorrentServer) GetAPIVersion(ctx context.Context) (string, error)
func (*QBittorrentServer) GetTorrent ¶
func (*QBittorrentServer) GetTorrentStatus ¶
func (q *QBittorrentServer) GetTorrentStatus(ctx context.Context, hash string) (*torrentv1alpha1.TorrentStatus, error)
func (*QBittorrentServer) GetTorrents ¶
func (q *QBittorrentServer) GetTorrents(ctx context.Context) ([]*Torrent, error)
func (*QBittorrentServer) Login ¶
func (q *QBittorrentServer) Login(username string, password string) error
func (*QBittorrentServer) MoveTorrent ¶
func (*QBittorrentServer) RenameTorrent ¶
func (*QBittorrentServer) ResumeTorrent ¶
func (q *QBittorrentServer) ResumeTorrent(ctx context.Context, hash string) error
func (*QBittorrentServer) StopTorrent ¶
func (q *QBittorrentServer) StopTorrent(ctx context.Context, hash string) error
type TorrentState ¶
type TorrentState string
const ( // StateError represent a torrent in error state StateError TorrentState = "Error" // StateDownloading represent a torrent in downloading state StateDownloading TorrentState = "Downloading" // StateSeeding represent a torrent in seeding state StateSeeding TorrentState = "Seeding" // StatePaused represent a torrent in paused state StatePaused TorrentState = "Paused" // StateChecking represent a torrent in checking state StateChecking TorrentState = "Checking" // StateWarming represent a torrent in warming state StateWarming TorrentState = "Warming" // StateUnknown represent a torrent in unknown state StateUnknown TorrentState = "Unknown" )
func (TorrentState) String ¶
func (s TorrentState) String() string
type TransmissionServer ¶
type TransmissionServer struct {
// contains filtered or unexported fields
}
func NewTransmissionServer ¶
func NewTransmissionServer(btServerSpec torrentv1alpha1.BtServerSpec) *TransmissionServer
func (*TransmissionServer) AddTorrentByURL ¶
func (s *TransmissionServer) AddTorrentByURL(ctx context.Context, torrentUrl string, torrent *torrentv1alpha1.Torrent) error
func (*TransmissionServer) DeleteTorrent ¶
func (*TransmissionServer) GetAPIVersion ¶
func (s *TransmissionServer) GetAPIVersion(ctx context.Context) (string, error)
func (*TransmissionServer) GetTorrent ¶
func (*TransmissionServer) GetTorrentStatus ¶
func (s *TransmissionServer) GetTorrentStatus(ctx context.Context, hash string) (*torrentv1alpha1.TorrentStatus, error)
func (*TransmissionServer) GetTorrents ¶
func (s *TransmissionServer) GetTorrents(ctx context.Context) ([]*Torrent, error)
func (*TransmissionServer) Login ¶
func (s *TransmissionServer) Login(username string, password string) error
func (*TransmissionServer) MoveTorrent ¶
func (*TransmissionServer) RenameTorrent ¶
func (*TransmissionServer) ResumeTorrent ¶
func (s *TransmissionServer) ResumeTorrent(ctx context.Context, hash string) error
func (*TransmissionServer) StopTorrent ¶
func (s *TransmissionServer) StopTorrent(ctx context.Context, hash string) error
Click to show internal directories.
Click to hide internal directories.