1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-08-26 04:26:07 +08:00

coreapi: implement swarm api

License: MIT
Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
This commit is contained in:
Łukasz Magiera
2018-03-10 19:02:57 +01:00
parent 1373218519
commit 8358c8d041
4 changed files with 158 additions and 3 deletions

View File

@ -1,9 +1,9 @@
package iface
import (
"context"
"time"
"context"
ma "gx/ipfs/QmWWQ2Txc2c6tqjsBpzg5Ar652cHPGNsQQp2SejkNmkUMb/go-multiaddr"
peer "gx/ipfs/QmZoWKhxUmZ2seW4BzX6fJkNR8hh9PsGModr7q171yq2SS/go-libp2p-peer"
)
@ -17,11 +17,11 @@ type PeerInfo interface {
Address() ma.Multiaddr
// Latency returns last known round trip time to the peer
Latency() time.Duration
Latency(context.Context) (time.Duration, error)
// Streams returns list of streams established with the peer
// TODO: should this return multicodecs?
Streams() []string
Streams(context.Context) ([]string, error)
}
// SwarmAPI specifies the interface to libp2p swarm