Documentation ¶
Overview ¶
Package boltdbresumer provides a Resumer implementation that uses a Bolt database file as storage.
Index ¶
- Variables
- type Resumer
- func (r *Resumer) HandleStopAfterDownload(torrentID string) error
- func (r *Resumer) HandleStopAfterMetadata(torrentID string) error
- func (r *Resumer) Read(torrentID string) (spec *Spec, err error)
- func (r *Resumer) Write(torrentID string, spec *Spec) error
- func (r *Resumer) WriteBitfield(torrentID string, value []byte) error
- func (r *Resumer) WriteCompleteCmdRun(torrentID string) error
- func (r *Resumer) WriteInfo(torrentID string, value []byte) error
- func (r *Resumer) WriteStarted(torrentID string, value bool) error
- type Spec
Constants ¶
This section is empty.
Variables ¶
View Source
var Keys = struct { InfoHash []byte Port []byte Name []byte Trackers []byte URLList []byte FixedPeers []byte Dest []byte Info []byte Bitfield []byte AddedAt []byte BytesDownloaded []byte BytesUploaded []byte BytesWasted []byte SeededFor []byte Started []byte StopAfterDownload []byte StopAfterMetadata []byte CompleteCmdRun []byte }{ InfoHash: []byte("info_hash"), Port: []byte("port"), Name: []byte("name"), Trackers: []byte("trackers"), URLList: []byte("url_list"), FixedPeers: []byte("fixed_peers"), Dest: []byte("dest"), Info: []byte("info"), Bitfield: []byte("bitfield"), AddedAt: []byte("added_at"), BytesDownloaded: []byte("bytes_downloaded"), BytesUploaded: []byte("bytes_uploaded"), BytesWasted: []byte("bytes_wasted"), SeededFor: []byte("seeded_for"), Started: []byte("started"), StopAfterDownload: []byte("stop_after_download"), StopAfterMetadata: []byte("stop_after_metadata"), CompleteCmdRun: []byte("complete_cmd_run"), }
Keys for the persisten storage.
Functions ¶
This section is empty.
Types ¶
type Resumer ¶
type Resumer struct {
// contains filtered or unexported fields
}
Resumer contains methods for saving/loading resume information of a torrent to a BoltDB database.
func (*Resumer) HandleStopAfterDownload ¶ added in v1.8.10
HandleStopAfterDownload clears the start status and stop_after_download fields.
func (*Resumer) HandleStopAfterMetadata ¶ added in v1.8.10
HandleStopAfterMetadata clears the start status and stop_after_metadata fields.
func (*Resumer) WriteBitfield ¶
WriteBitfield writes only bitfield of a torrent.
func (*Resumer) WriteCompleteCmdRun ¶ added in v1.8.10
WriteCompleteCmdRun writes the start status of a torrent.
type Spec ¶
type Spec struct { InfoHash []byte Port int Name string Trackers [][]string URLList []string FixedPeers []string Info []byte Bitfield []byte AddedAt time.Time BytesDownloaded int64 BytesUploaded int64 BytesWasted int64 SeededFor time.Duration Started bool StopAfterDownload bool StopAfterMetadata bool CompleteCmdRun bool }
Spec contains fields for resuming an existing torrent.
func (Spec) MarshalJSON ¶ added in v1.8.10
MarshalJSON converts the Spec to a JSON string.
func (*Spec) UnmarshalJSON ¶ added in v1.8.10
UnmarshalJSON fills the Spec from a JSON string.
Click to show internal directories.
Click to hide internal directories.