go-libp2p-resource-manager/limit_defaults.go

24 lines
1.2 KiB
Go
Raw Permalink Normal View History

package rcmgr
2022-06-10 22:01:03 +08:00
import (
2022-08-18 20:21:11 +08:00
rcmgr "github.com/libp2p/go-libp2p/p2p/host/resource-manager"
2022-06-10 22:01:03 +08:00
)
2022-06-10 22:01:03 +08:00
// ScalingLimitConfig is a struct for configuring default limits.
// {}BaseLimit is the limits that Apply for a minimal node (128 MB of memory for libp2p) and 256 file descriptors.
2022-06-10 22:01:03 +08:00
// {}LimitIncrease is the additional limit granted for every additional 1 GB of RAM.
2022-08-18 20:21:11 +08:00
// Deprecated: use github.com/libp2p/go-libp2p/p2p/host/resource-manager.ScalingLimitConfig instead
type ScalingLimitConfig = rcmgr.ScalingLimitConfig
2022-08-18 20:21:11 +08:00
// Deprecated: use github.com/libp2p/go-libp2p/p2p/host/resource-manager.LimitConfig instead
type LimitConfig = rcmgr.LimitConfig
2022-01-17 17:17:11 +08:00
// DefaultLimits are the limits used by the default limiter constructors.
2022-08-18 20:21:11 +08:00
// Deprecated: use github.com/libp2p/go-libp2p/p2p/host/resource-manager.DefaultLimits instead
var DefaultLimits = rcmgr.DefaultLimits
// InfiniteLimits are a limiter configuration that uses infinite limits, thus effectively not limiting anything.
// Keep in mind that the operating system limits the number of file descriptors that an application can use.
2022-08-18 20:21:11 +08:00
// Deprecated: use github.com/libp2p/go-libp2p/p2p/host/resource-manager.InfiniteLimits instead
var InfiniteLimits = rcmgr.InfiniteLimits