This repository has been archived by the owner on Sep 6, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 75
/
manager.go
36 lines (32 loc) · 1.6 KB
/
manager.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
27
28
29
30
31
32
33
34
35
36
// Deprecated: This package has moved into go-libp2p as a sub-package: github.com/libp2p/go-libp2p/core/connmgr.
//
// Package connmgr provides connection tracking and management interfaces for libp2p.
//
// The ConnManager interface exported from this package allows libp2p to enforce an
// upper bound on the total number of open connections. To avoid service disruptions,
// connections can be tagged with metadata and optionally "protected" to ensure that
// essential connections are not arbitrarily cut.
package connmgr
import (
"github.com/libp2p/go-libp2p/core/connmgr"
)
// SupportsDecay evaluates if the provided ConnManager supports decay, and if
// so, it returns the Decayer object. Refer to godocs on Decayer for more info.
// Deprecated: use github.com/libp2p/go-libp2p/core/connmgr.SupportsDecay instead
func SupportsDecay(mgr ConnManager) (Decayer, bool) {
return connmgr.SupportsDecay(mgr)
}
// ConnManager tracks connections to peers, and allows consumers to associate
// metadata with each peer.
//
// It enables connections to be trimmed based on implementation-defined
// heuristics. The ConnManager allows libp2p to enforce an upper bound on the
// total number of open connections.
//
// ConnManagers supporting decaying tags implement Decayer. Use the
// SupportsDecay function to safely cast an instance to Decayer, if supported.
// Deprecated: use github.com/libp2p/go-libp2p/core/connmgr.ConnManager instead
type ConnManager = connmgr.ConnManager
// TagInfo stores metadata associated with a peer.
// Deprecated: use github.com/libp2p/go-libp2p/core/connmgr.TagInfo instead
type TagInfo = connmgr.TagInfo