Documentation ¶
Overview ¶
Package boltdbresumer provides a Resumer implementation that uses a Bolt database file as storage.
Index ¶
- Variables
- type Resumer
- func (r *Resumer) Read(torrentID string) (*Spec, error)
- func (r *Resumer) Write(torrentID string, spec *Spec) error
- func (r *Resumer) WriteBitfield(torrentID string, value []byte) 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 }{ 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"), }
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) WriteBitfield ¶
WriteBitfield writes only bitfield 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 }
Spec contains fields for resuming an existing torrent.
func (Spec) MarshalJSON ¶ added in v0.15.0
MarshalJSON converts the Spec to a JSON string.
func (*Spec) UnmarshalJSON ¶ added in v0.15.0
UnmarshalJSON fills the Spec from a JSON string.
Click to show internal directories.
Click to hide internal directories.