Add PeerStorer interface
This commit is contained in:
parent
cff461c898
commit
051093ca31
6
dht.go
6
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
|
||||
|
|
Loading…
Reference in New Issue