Documentation
¶
Index ¶
- func CopyFile(src, dst string) (err error)
- type ClientMigrater
- type ClientType
- type DelugeImport
- type Fastresume
- type Migrater
- type Options
- type RTorrentImport
- type RTorrentLibTorrentResumeFile
- type RTorrentResumeFileEntry
- type RTorrentTorrentFile
- type TransmissionImport
- type TransmissionResumeFile
- type TransmissionResumeFileIdleLimit
- type TransmissionResumeFileProgress
- type TransmissionResumeFileRatioLimit
- type TransmissionResumeFileSpeedLimit
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CopyFile ¶
CopyFile copies the contents of the file named src to the file named by dst. The file will be created if it does not already exist. If the destination file exists, all it's contents will be replaced by the contents of the source file. The file mode will be copied from the source and the copied data is synced/flushed to stable storage.
Types ¶
type ClientMigrater ¶
type ClientMigrater interface {
Migrate() error
}
type ClientType ¶
type ClientType string
var ( ClientTypeDeluge ClientType = "deluge" ClientTypeRTorrent ClientType = "rtorrent" ClientTypeTransmission ClientType = "transmission" )
type DelugeImport ¶
type DelugeImport struct {
// contains filtered or unexported fields
}
func NewDelugeImporter ¶
func NewDelugeImporter(opts Options) *DelugeImport
func (*DelugeImport) Migrate ¶
func (di *DelugeImport) Migrate() error
type Fastresume ¶
type Fastresume struct {
ActiveTime int64 `bencode:"active_time"`
AddedTime int64 `bencode:"added_time"`
Allocation string `bencode:"allocation"`
ApplyIPFilter int64 `bencode:"apply_ip_filter"`
AnnounceToDht int64 `bencode:"announce_to_dht,omitempty"`
AnnounceToLsd int64 `bencode:"announce_to_lsd,omitempty"`
AnnounceToTrackers int64 `bencode:"announce_to_trackers,omitempty"`
AutoManaged int64 `bencode:"auto_managed"`
CompletedTime int64 `bencode:"completed_time"`
DisableDHT int64 `bencode:"disable_dht"`
DisableLSD int64 `bencode:"disable_lsd"`
DisablePEX int64 `bencode:"disable_pex"`
DownloadRateLimit int64 `bencode:"download_rate_limit"`
FileFormat string `bencode:"file-format"`
FileVersion int64 `bencode:"file-version"`
FilePriority []int `bencode:"file_priority"`
FileSizes [][]int64 `bencode:"file sizes,omitempty"`
FinishedTime int64 `bencode:"finished_time"`
HTTPSeeds []string `bencode:"httpseeds,omitempty"`
InfoHash []byte `bencode:"info-hash"`
LastDownload int64 `bencode:"last_download"`
LastSeenComplete int64 `bencode:"last_seen_complete"`
LastUpload int64 `bencode:"last_upload"`
LibTorrentVersion string `bencode:"libtorrent-version"`
MaxConnections int64 `bencode:"max_connections"`
MaxUploads int64 `bencode:"max_uploads"`
Name string `bencode:"name,omitempty"`
NumComplete int64 `bencode:"num_complete"`
NumDownloaded int64 `bencode:"num_downloaded"`
NumIncomplete int64 `bencode:"num_incomplete"`
Paused int64 `bencode:"paused"`
Pieces string `bencode:"pieces"`
PiecePriority []byte `bencode:"piece_priority"`
Peers string `bencode:"peers"`
Peers6 string `bencode:"peers6"`
QbtCategory string `bencode:"qBt-category"`
QbtContentLayout string `bencode:"qBt-contentLayout"`
QbtHasRootFolder int64 `bencode:"qBt-hasRootFolder"`
QbtFirstLastPiecePriority int64 `bencode:"qBt-firstLastPiecePriority"`
QbtName string `bencode:"qBt-name"`
QbtRatioLimit int64 `bencode:"qBt-ratioLimit"`
QbtSavePath string `bencode:"qBt-savePath"`
QbtSeedStatus int64 `bencode:"qBt-seedStatus"`
QbtSeedingTimeLimit int64 `bencode:"qBt-seedingTimeLimit"`
QbtTags []string `bencode:"qBt-tags"`
QbtQueuePosition int `bencode:"qBt-queuePosition,omitempty"`
QbtTempPathDisabled int64 `bencode:"qBt-tempPathDisabled,omitempty"`
SavePath string `bencode:"save_path"`
SeedMode int64 `bencode:"seed_mode"`
SeedingTime int64 `bencode:"seeding_time"`
SequentialDownload int64 `bencode:"sequential_download"`
StopWhenReady int64 `bencode:"stop_when_ready"`
SuperSeeding int64 `bencode:"super_seeding"`
TotalDownloaded int64 `bencode:"total_downloaded"`
TotalUploaded int64 `bencode:"total_uploaded"`
Trackers [][]string `bencode:"trackers,omitempty"`
UploadMode int64 `bencode:"upload_mode"`
UploadRateLimit int64 `bencode:"upload_rate_limit"`
URLList []string `bencode:"url-list"`
Unfinished *[]any `bencode:"unfinished,omitempty"`
TorrentFilePath string `bencode:"-"`
MappedFiles []string `bencode:"mapped_files,omitempty"`
}
Fastresume represents a qBittorrent fastresume file
func (*Fastresume) ConvertFilePriority ¶
func (fr *Fastresume) ConvertFilePriority(numFiles int)
ConvertFilePriority for each file set priority
func (*Fastresume) Encode ¶
func (fr *Fastresume) Encode(path string) error
Encode qBittorrent fastresume file
type Options ¶
type Options struct {
Source ClientType
SourceDir string
QbitDir string
DryRun bool
SkipBackup bool
}
type RTorrentImport ¶
type RTorrentImport struct {
// contains filtered or unexported fields
}
func NewRTorrentImporter ¶
func NewRTorrentImporter(opts Options) *RTorrentImport
func (*RTorrentImport) Migrate ¶
func (i *RTorrentImport) Migrate() error
type RTorrentLibTorrentResumeFile ¶
type RTorrentLibTorrentResumeFile struct {
Bitfield any `bencode:"bitfield"`
Files []RTorrentResumeFileEntry `bencode:"files"`
Trackers map[string]map[string]int `bencode:"trackers"`
}
type RTorrentResumeFileEntry ¶
type RTorrentTorrentFile ¶
type RTorrentTorrentFile struct {
Complete int64 `bencode:"complete"`
Custom struct {
AddTime string `bencode:"addtime"`
SeedingTime string `bencode:"seedingtime"`
} `bencode:"custom"`
Custom1 string `bencode:"custom1"`
Directory string `bencode:"directory"`
State int64 `bencode:"state"`
TotalDownloaded int64 `bencode:"total_downloaded"`
TotalUploaded int64 `bencode:"total_uploaded"`
TimestampFinished int64 `bencode:"timestamp.finished"`
TimestampStarted int64 `bencode:"timestamp.started"`
}
type TransmissionImport ¶
type TransmissionImport struct {
// contains filtered or unexported fields
}
func NewTransmissionImporter ¶
func NewTransmissionImporter(opts Options) *TransmissionImport
func (*TransmissionImport) Migrate ¶
func (i *TransmissionImport) Migrate() error
type TransmissionResumeFile ¶
type TransmissionResumeFile struct {
Files []string `bencode:"files"`
Name string `bencode:"name"`
Corrupted int64 `bencode:"corrupt"`
Destination string `bencode:"destination"`
IncompleteDir string `bencode:"incomplete-dir"`
Downloaded int64 `bencode:"downloaded"`
Uploaded int64 `bencode:"uploaded"`
Group string `bencode:"group"`
BandwidthPriority int `bencode:"bandwidth-priority"`
Priority []int `bencode:"priority"`
DoneDate int64 `bencode:"done-date"`
DownloadingTimeSeconds int64 `bencode:"downloading-time-seconds"`
Labels []string `bencode:"labels"`
MaxPeers int64 `bencode:"max-peers"`
Paused bool `bencode:"paused"`
Peers string `bencode:"peers2"`
ActivityDate int64 `bencode:"activity-date"`
AddedDate int64 `bencode:"added-date"`
Dnd []int `bencode:"dnd"`
SeedingTimeSeconds int64 `bencode:"seeding-time-seconds"`
Progress TransmissionResumeFileProgress `bencode:"progress"`
IdleLimit TransmissionResumeFileIdleLimit `bencode:"idle-limit"`
RatioLimit TransmissionResumeFileRatioLimit `bencode:"ratio-limit"`
SpeedLimitUp TransmissionResumeFileSpeedLimit `bencode:"speed-limit-up"`
SpeedLimitDown TransmissionResumeFileSpeedLimit `bencode:"speed-limit-down"`
}
Click to show internal directories.
Click to hide internal directories.