Documentation ¶
Index ¶
- type FileBackup
- type Memory
- func (db *Memory) Backup() storage.Backup
- func (db *Memory) Check() bool
- func (db *Memory) Drop(hash storage.Hash, id storage.PeerID)
- func (db *Memory) HashStats(hash storage.Hash) (complete, incomplete uint16)
- func (db *Memory) Hashes() int
- func (db *Memory) Init(backup storage.Backup) error
- func (db *Memory) PeerList(hash storage.Hash, numWant uint, removePeerId bool) (peers [][]byte)
- func (db *Memory) PeerListBytes(hash storage.Hash, numWant uint) (peers4 []byte, peers6 []byte)
- func (memoryDb *Memory) Save(ip netip.Addr, port uint16, complete bool, hash storage.Hash, ...)
- func (db *Memory) SyncExpvars() error
- func (db *Memory) Trim()
- type NoneBackup
- type PeerMap
- type PgBackup
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FileBackup ¶
type FileBackup struct {
// contains filtered or unexported fields
}
FileBackup backs up the peer database to a local file.
func (*FileBackup) Load ¶
func (bck *FileBackup) Load() error
func (*FileBackup) Save ¶
func (bck *FileBackup) Save() error
Save encodes and writes the database to a file
type Memory ¶
type Memory struct {
// contains filtered or unexported fields
}
func (*Memory) HashStats ¶
HashStats returns number of complete and incomplete peers associated with the hash
func (*Memory) PeerListBytes ¶
PeerListBytes returns a byte encoded peer list for the given hash capped at num
func (*Memory) SyncExpvars ¶
type NoneBackup ¶
type NoneBackup struct{}
NoneBackup is an empty backup driver. It doesn't back anything up.
func (NoneBackup) Load ¶
func (bck NoneBackup) Load() error
func (NoneBackup) Save ¶
func (bck NoneBackup) Save() error
Click to show internal directories.
Click to hide internal directories.