/
null.go
24 lines (19 loc) · 1.1 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
package connmgr
import (
"context"
"github.com/ipfs/fs-repo-migrations/ipfs-10-to-11/_vendor/github.com/libp2p/go-libp2p-core/network"
"github.com/ipfs/fs-repo-migrations/ipfs-10-to-11/_vendor/github.com/libp2p/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) Close() error { return nil }