limits

package
v0.45.0-rc.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 10, 2025 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NoLimit            int64 = math.MaxInt64
	DefaultIdleTimeout       = 5 * time.Minute
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config config.Config

Config is a wrapper over the config section which provides access to Shard's limits configurations.

func From

func From(c *config.Config) *Config

From wraps config section into Config.

func (*Config) Read

func (x *Config) Read() OpConfig

Read returns the value of "read" limits config section.

func (*Config) Write

func (x *Config) Write() OpConfig

Write returns the value of "write" limits config section.

type IOTagConfig

type IOTagConfig struct {
	Tag         string
	Weight      *float64
	LimitOps    *float64
	ReservedOps *float64
	Prohibited  bool
}

type OpConfig

type OpConfig struct {
	// MaxWaitingOps returns the value of "max_waiting_ops" config parameter.
	//
	// Equals NoLimit if the value is not a positive number.
	MaxWaitingOps int64
	// MaxRunningOps returns the value of "max_running_ops" config parameter.
	//
	// Equals NoLimit if the value is not a positive number.
	MaxRunningOps int64
	// IdleTimeout returns the value of "idle_timeout" config parameter.
	//
	// Equals DefaultIdleTimeout if the value is not a valid duration.
	IdleTimeout time.Duration
	// Tags returns the value of "tags" config parameter.
	//
	// Equals nil if the value is not a valid tags config slice.
	Tags []IOTagConfig
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL