Documentation
¶
Index ¶
- type ADNL
- type AddByHash
- type AddByMeta
- type CreateTorrent
- type DaemonError
- type Double
- type FileInfo
- type GetPeers
- type GetSpeedLimits
- type GetTorrentFull
- type GetTorrentMeta
- type GetTorrents
- type MetaFile
- type Peer
- type PeersList
- type PriorityActionAll
- type PriorityActionIndex
- type PriorityActionName
- type PriorityStatusPending
- type PriorityStatusSet
- type RemoveTorrent
- type SetActiveDownload
- type SetActiveUpload
- type SetFilePriorityByName
- type SetSpeedLimits
- type SpeedLimits
- type StorageClient
- func (s *StorageClient) AddByHash(ctx context.Context, hash []byte, dir string) (*TorrentFull, error)
- func (s *StorageClient) AddByMeta(ctx context.Context, meta []byte, dir string) (*TorrentFull, error)
- func (s *StorageClient) CreateTorrent(ctx context.Context, dir, description string) (*TorrentFull, error)
- func (s *StorageClient) GetPeers(ctx context.Context, hash []byte) (*PeersList, error)
- func (s *StorageClient) GetSpeedLimits(ctx context.Context) (*SpeedLimits, error)
- func (s *StorageClient) GetTorrentFull(ctx context.Context, hash []byte) (*TorrentFull, error)
- func (s *StorageClient) GetTorrentMeta(ctx context.Context, hash []byte) ([]byte, error)
- func (s *StorageClient) GetTorrents(ctx context.Context) (*TorrentsList, error)
- func (s *StorageClient) RemoveTorrent(ctx context.Context, hash []byte, withFiles bool) error
- func (s *StorageClient) SetActive(ctx context.Context, hash []byte, active bool) error
- func (s *StorageClient) SetFilePriority(ctx context.Context, hash []byte, name string, priority int32) error
- func (s *StorageClient) SetSpeedLimits(ctx context.Context, download, upload int64) error
- type Success
- type Torrent
- type TorrentFull
- type TorrentMeta
- type TorrentsList
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ADNL ¶
type ADNL interface {
QueryADNL(ctx context.Context, payload, response tl.Serializable) error
}
type CreateTorrent ¶
type DaemonError ¶
type DaemonError struct {
Message string `tl:"string"`
}
type GetSpeedLimits ¶
type GetSpeedLimits struct {
Flags uint32 `tl:"int"`
}
type GetTorrentFull ¶
type GetTorrentMeta ¶
type GetTorrents ¶
type GetTorrents struct {
Flags uint32 `tl:"int"`
}
type MetaFile ¶
type MetaFile struct { Hash []byte Info storage.TorrentInfo }
type PriorityActionAll ¶
type PriorityActionAll struct {
Priority int32 `tl:"int"`
}
type PriorityActionIndex ¶
type PriorityActionName ¶
type PriorityStatusPending ¶
type PriorityStatusPending struct{}
type PriorityStatusSet ¶
type PriorityStatusSet struct{}
type RemoveTorrent ¶
type SetActiveDownload ¶
type SetActiveUpload ¶
type SetFilePriorityByName ¶
type SetSpeedLimits ¶
type SpeedLimits ¶
type StorageClient ¶
type StorageClient struct {
// contains filtered or unexported fields
}
func NewStorageClient ¶
func NewStorageClient(client ADNL) *StorageClient
func (*StorageClient) AddByHash ¶
func (s *StorageClient) AddByHash(ctx context.Context, hash []byte, dir string) (*TorrentFull, error)
func (*StorageClient) AddByMeta ¶
func (s *StorageClient) AddByMeta(ctx context.Context, meta []byte, dir string) (*TorrentFull, error)
func (*StorageClient) CreateTorrent ¶
func (s *StorageClient) CreateTorrent(ctx context.Context, dir, description string) (*TorrentFull, error)
func (*StorageClient) GetSpeedLimits ¶
func (s *StorageClient) GetSpeedLimits(ctx context.Context) (*SpeedLimits, error)
func (*StorageClient) GetTorrentFull ¶
func (s *StorageClient) GetTorrentFull(ctx context.Context, hash []byte) (*TorrentFull, error)
func (*StorageClient) GetTorrentMeta ¶
func (*StorageClient) GetTorrents ¶
func (s *StorageClient) GetTorrents(ctx context.Context) (*TorrentsList, error)
func (*StorageClient) RemoveTorrent ¶
func (*StorageClient) SetFilePriority ¶
func (*StorageClient) SetSpeedLimits ¶
func (s *StorageClient) SetSpeedLimits(ctx context.Context, download, upload int64) error
type Torrent ¶
type Torrent struct { Hash []byte Flags uint32 TotalSize *uint64 // 0 Description *string // 0 FilesCount *uint64 // 1 IncludedSize *uint64 // 1 DirName *string // 1 AddedAt uint32 DownloadedSize uint64 RootDir string ActiveDownload bool ActiveUpload bool Completed bool DownloadSpeed float64 UploadSpeed float64 FatalError *string // 2 }
type TorrentFull ¶
type TorrentMeta ¶
type TorrentMeta struct {
Meta []byte `tl:"bytes"`
}
type TorrentsList ¶
type TorrentsList struct {
Torrents []Torrent `tl:"vector struct"`
}
Click to show internal directories.
Click to hide internal directories.