Documentation
¶
Overview ¶
Package limits defines opt-in resource limits shared by one QuickJS runtime.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrFetchConcurrencyExceeded = errors.New("fetch concurrency limit exceeded") ErrWebSocketConcurrencyExceeded = errors.New("websocket connection limit exceeded") )
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
ExecuteTimeout time.Duration
MaxFetchConcurrent int
MaxFetchResponseBytes int64
MaxWebSocketConnections int
MaxWebSocketMessageBytes int64
MaxFilesystemReadBytes int64
MaxFilesystemWriteBytes int64
MaxPBKDF2Iterations int
MaxPBKDF2OutputBytes int
}
Config configures one QuickJS runtime. Zero values leave the corresponding resource unlimited.
type Runtime ¶
type Runtime struct {
// contains filtered or unexported fields
}
Runtime owns counters shared by every API surface in one QuickJS runtime.
func NewRuntime ¶
NewRuntime validates and copies config before constructing shared counters.
func (*Runtime) AcquireFetch ¶
AcquireFetch reserves one fetch slot until its idempotent release is called.
func (*Runtime) AcquireWebSocket ¶
AcquireWebSocket reserves one connection slot until its idempotent release is called.
Click to show internal directories.
Click to hide internal directories.