From: Matt Joiner Date: Sun, 21 Feb 2021 06:17:57 +0000 (+1100) Subject: Add PeerStorer interface X-Git-Tag: v1.26.0-alpha~13 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=051093ca31f5797b1b6dc3ccac2ca2c32345fb1f;p=btrtrc.git Add PeerStorer interface --- diff --git a/dht.go b/dht.go index da79aee4..b69c2884 100644 --- a/dht.go +++ b/dht.go @@ -6,6 +6,7 @@ import ( "github.com/anacrolix/dht/v2" "github.com/anacrolix/dht/v2/krpc" + peer_store "github.com/anacrolix/dht/v2/peer-store" ) type DhtServer interface { @@ -18,6 +19,11 @@ type DhtServer interface { WriteStatus(io.Writer) } +// Optional interface for DhtServer's that can expose their peer store (if any). +type PeerStorer interface { + PeerStore() peer_store.Interface +} + type DhtAnnounce interface { Close() Peers() <-chan dht.PeersValues