Commit c34d4df9 authored by Brian Tiger Chow's avatar Brian Tiger Chow

feat(bitswap:network) define a service interface for use with net/service/Service

parent 503b1aa7
...@@ -19,3 +19,10 @@ type Receiver interface { ...@@ -19,3 +19,10 @@ type Receiver interface {
ctx context.Context, sender *peer.Peer, incoming bsmsg.BitSwapMessage) ( ctx context.Context, sender *peer.Peer, incoming bsmsg.BitSwapMessage) (
outgoing bsmsg.BitSwapMessage, destination *peer.Peer, err error) outgoing bsmsg.BitSwapMessage, destination *peer.Peer, err error)
} }
// TODO(brian): move this to go-ipfs/net package
type NetworkService interface {
SendRequest(ctx context.Context, m netmsg.NetMessage) (netmsg.NetMessage, error)
SendMessage(ctx context.Context, m netmsg.NetMessage) error
SetHandler(netservice.Handler)
}
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