-
Notifications
You must be signed in to change notification settings - Fork 1
/
null.go
26 lines (20 loc) · 1.03 KB
/
null.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
package ifconnmgr
import (
"context"
inet "github.com/ipsn/go-ipfs/gxlibs/github.com/libp2p/go-libp2p-net"
peer "github.com/ipsn/go-ipfs/gxlibs/github.com/libp2p/go-libp2p-peer"
ma "github.com/ipsn/go-ipfs/gxlibs/github.com/multiformats/go-multiaddr"
)
type NullConnMgr struct{}
func (_ NullConnMgr) TagPeer(peer.ID, string, int) {}
func (_ NullConnMgr) UntagPeer(peer.ID, string) {}
func (_ NullConnMgr) GetTagInfo(peer.ID) *TagInfo { return &TagInfo{} }
func (_ NullConnMgr) TrimOpenConns(context.Context) {}
func (_ NullConnMgr) Notifee() inet.Notifiee { return &cmNotifee{} }
type cmNotifee struct{}
func (nn *cmNotifee) Connected(n inet.Network, c inet.Conn) {}
func (nn *cmNotifee) Disconnected(n inet.Network, c inet.Conn) {}
func (nn *cmNotifee) Listen(n inet.Network, addr ma.Multiaddr) {}
func (nn *cmNotifee) ListenClose(n inet.Network, addr ma.Multiaddr) {}
func (nn *cmNotifee) OpenedStream(inet.Network, inet.Stream) {}
func (nn *cmNotifee) ClosedStream(inet.Network, inet.Stream) {}