Documentation ¶
Index ¶
- type API
- func (a *API) AddTorrentByHash(hash, rootDir string) error
- func (a *API) AddTorrentByMeta(meta []byte, rootDir string) error
- func (a *API) CheckTorrentHeader(hash string) (bool, error)
- func (a *API) CreateTorrent(dir, description string) (string, error)
- func (a *API) GetInfo(hash string) (*TorrentInfo, error)
- func (a *API) GetPeers(hash string) ([]Peer, error)
- func (a *API) GetPlainFiles(hash string) ([]PlainFile, error)
- func (a *API) GetSpeedLimits() (*SpeedLimits, error)
- func (a *API) GetTorrentFiles(hash string) ([]*File, error)
- func (a *API) GetTorrentMeta(hash string) ([]byte, error)
- func (a *API) GetTorrents() []*Torrent
- func (a *API) RemoveTorrent(hash string, withFiles, onlyNotInitiated bool) error
- func (a *API) SetActive(hash string, active bool) error
- func (a *API) SetOnListRefresh(handler func())
- func (a *API) SetPriorities(hash string, list []string, priority int) error
- func (a *API) SetSpeedLimits(limits *SpeedLimits) error
- func (a *API) SetSpeedRefresh(handler func(Speed))
- func (a *API) SyncTorrents() error
- type File
- type Peer
- type PlainFile
- type Speed
- type SpeedLimits
- type StorageClient
- type Torrent
- type TorrentInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type API ¶
type API struct {
// contains filtered or unexported fields
}
func (*API) AddTorrentByHash ¶
func (*API) GetSpeedLimits ¶
func (a *API) GetSpeedLimits() (*SpeedLimits, error)
func (*API) GetTorrents ¶
func (*API) RemoveTorrent ¶
func (*API) SetOnListRefresh ¶
func (a *API) SetOnListRefresh(handler func())
func (*API) SetPriorities ¶
func (*API) SetSpeedLimits ¶
func (a *API) SetSpeedLimits(limits *SpeedLimits) error
func (*API) SetSpeedRefresh ¶
func (*API) SyncTorrents ¶
type SpeedLimits ¶
type StorageClient ¶
type StorageClient interface { GetTorrents(ctx context.Context) (*client.TorrentsList, error) AddByHash(ctx context.Context, hash []byte, dir string) (*client.TorrentFull, error) AddByMeta(ctx context.Context, meta []byte, dir string) (*client.TorrentFull, error) CreateTorrent(ctx context.Context, dir, description string) (*client.TorrentFull, error) GetTorrentFull(ctx context.Context, hash []byte) (*client.TorrentFull, error) GetTorrentMeta(ctx context.Context, hash []byte) ([]byte, error) GetPeers(ctx context.Context, hash []byte) (*client.PeersList, error) RemoveTorrent(ctx context.Context, hash []byte, withFiles bool) error SetActive(ctx context.Context, hash []byte, active bool) error SetFilePriority(ctx context.Context, hash []byte, name string, priority int32) error GetSpeedLimits(ctx context.Context) (*client.SpeedLimits, error) SetSpeedLimits(ctx context.Context, download, upload int64) error }
Click to show internal directories.
Click to hide internal directories.