Documentation ¶
Index ¶
- Constants
- type Transmission
- func (v *Transmission) TorrentAddFile(ctx context.Context, filepath string) (transmissionrpc.Torrent, error)
- func (v *Transmission) TorrentAddUrl(ctx context.Context, magnetUrl string) (transmissionrpc.Torrent, error)
- func (v *Transmission) TorrentGetAll(ctx context.Context) ([]transmissionrpc.Torrent, error)
- func (v *Transmission) TorrentRemove(ctx context.Context, ids []int64) error
- func (v *Transmission) TorrentStopIDs(ctx context.Context, ids []int64) error
Constants ¶
const ( ID = "transmission" EndpointKey = "endpoint" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Transmission ¶
type Transmission struct {
// contains filtered or unexported fields
}
func NewTransmission ¶
func NewTransmission(endpoint string) (*Transmission, error)
func (*Transmission) TorrentAddFile ¶
func (v *Transmission) TorrentAddFile(ctx context.Context, filepath string) (transmissionrpc.Torrent, error)
TorrentAddFile adds a new torrent by uploading a .torrent file.
ctx is the context for the request. filepath is the path to the .torrent file. Returns transmissionrpc.Torrent and error.
func (*Transmission) TorrentAddUrl ¶
func (v *Transmission) TorrentAddUrl(ctx context.Context, magnetUrl string) (transmissionrpc.Torrent, error)
TorrentAddUrl adds a torrent to the Transmission client using a magnet link.
ctx - the context for the function. url - the magnet link to add. (transmissionrpc.Torrent, error) - returns the added torrent or an error.
func (*Transmission) TorrentGetAll ¶
func (v *Transmission) TorrentGetAll(ctx context.Context) ([]transmissionrpc.Torrent, error)
TorrentGetAll returns all the known fields for all the torrents.
func (*Transmission) TorrentRemove ¶
func (v *Transmission) TorrentRemove(ctx context.Context, ids []int64) error
TorrentRemove allows to delete one or more torrents only.
func (*Transmission) TorrentStopIDs ¶
func (v *Transmission) TorrentStopIDs(ctx context.Context, ids []int64) error
TorrentStopIDs stops torrent(s) which id is in the provided slice. Can be one, can be several, can be all (if slice is empty or nil).