mirror of
https://github.com/libp2p/go-libp2p-resource-manager.git
synced 2025-03-27 04:21:39 +08:00
25 lines
550 B
Go
25 lines
550 B
Go
package rcmgr
|
|
|
|
import (
|
|
"github.com/libp2p/go-libp2p-core/network"
|
|
"github.com/libp2p/go-libp2p-core/peer"
|
|
"github.com/libp2p/go-libp2p-core/protocol"
|
|
)
|
|
|
|
type Limit interface {
|
|
GetMemoryLimit() int64
|
|
GetStreamLimit(network.Direction) int
|
|
GetConnLimit(network.Direction) int
|
|
GetFDLimit() int
|
|
}
|
|
|
|
type Limiter interface {
|
|
GetSystemLimits() Limit
|
|
GetTransientLimits() Limit
|
|
GetServiceLimits(svc string) Limit
|
|
GetProtocolLimits(proto protocol.ID) Limit
|
|
GetPeerLimits(p peer.ID) Limit
|
|
GetStreamLimits(p peer.ID) Limit
|
|
GetConnLimits() Limit
|
|
}
|