mirror of
https://github.com/libp2p/go-libp2p-core.git
synced 2024-12-26 23:30:27 +08:00
ea8b36912f
* run go mod tidy * omit receiver name if unused * remove unused type testkey in tests * fix duplicate import of go-multiaddr * fix use of deprecated peer.IDB58{Encode,Decode} * use bytes.Equal instead of bytes.Compare * fix unnecessary assigments to blank identifier * use time.Until instead of t.Sub(time.Now()) * fix use of deprecated go-multihash.ID * add missing error check in envelope test * fix error check in tests
25 lines
988 B
Go
25 lines
988 B
Go
package connmgr
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/libp2p/go-libp2p-core/network"
|
|
"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 }
|