Commit 3ab7f142 authored by Łukasz Magiera's avatar Łukasz Magiera

coreapi: implement swarm api

License: MIT
Signed-off-by: default avatarŁukasz Magiera <magik6k@gmail.com>
parent bc2ae0a4
......@@ -34,6 +34,9 @@ type CoreAPI interface {
// Dht returns an implementation of Dht API
Dht() DhtAPI
// Swarm returns an implementation of Swarm API
Swarm() SwarmAPI
// ResolvePath resolves the path using Unixfs resolver
ResolvePath(context.Context, Path) (ResolvedPath, error)
......
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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment