forked from libp2p/go-libp2p
-
Notifications
You must be signed in to change notification settings - Fork 0
/
null.go
25 lines (20 loc) · 1.04 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
package connmgr
import (
"context"
"github.com/zbliujia/go-libp2p/core/network"
"github.com/zbliujia/go-libp2p/core/peer"
)
// NullConnMgr is a ConnMgr that provides no functionality.
type NullConnMgr struct{}
var _ ConnManager = (*NullConnMgr)(nil)
func (NullConnMgr) TagPeer(peer.ID, string, int) {}
func (NullConnMgr) UntagPeer(peer.ID, string) {}
func (NullConnMgr) UpsertTag(peer.ID, string, func(int) int) {}
func (NullConnMgr) GetTagInfo(peer.ID) *TagInfo { return &TagInfo{} }
func (NullConnMgr) TrimOpenConns(ctx context.Context) {}
func (NullConnMgr) Notifee() network.Notifiee { return network.GlobalNoopNotifiee }
func (NullConnMgr) Protect(peer.ID, string) {}
func (NullConnMgr) Unprotect(peer.ID, string) bool { return false }
func (NullConnMgr) IsProtected(peer.ID, string) bool { return false }
func (NullConnMgr) CheckLimit(l GetConnLimiter) error { return nil }
func (NullConnMgr) Close() error { return nil }