limits

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LimitRequestBodySize = 1 * units.MEGABYTE
	LimitMaxDMLSize      = 768 * units.KILOBYTE
	LimitFieldValueSize  = 512 * units.KILOBYTE

	LimitMaxMutateRequestCount = 100
	LimitWriterCookieSize      = 1024

	LimitWriterSecretMaxLength = 100
	LimitWriterSecretMinLength = 3
)

Variables

This section is empty.

Functions

This section is empty.

Types

type RateLimit

type RateLimit struct {
	Amount int64         `json:"amount"`
	Period time.Duration `json:"period"`
}

RateLimit composes an amount allowed per duration

func (RateLimit) AdjustAmount

func (l RateLimit) AdjustAmount(period time.Duration) (int64, error)

adjustAmount adjusts the composed amount for the specified period, rounded to the nearest second

func (RateLimit) String

func (l RateLimit) String() string

func (*RateLimit) UnmarshalJSON

func (l *RateLimit) UnmarshalJSON(b []byte) error

UnmarshalJSON allows us to deser time.Durations using string values

type SizeLimits

type SizeLimits struct {
	MaxSize  int64 `json:"max-size"`
	WarnSize int64 `json:"warn-size"`
}

SizeLimits composes a max and a warn size

type TableSizeLimit

type TableSizeLimit struct {
	SizeLimits
	Family string `json:"family"`
	Table  string `json:"table"`
}

TableSizeLimit represents the limit for a particular table

type TableSizeLimits

type TableSizeLimits struct {
	Global SizeLimits       `json:"global"`
	Tables []TableSizeLimit `json:"tables"`
}

TableSizeLimits is a representation of all of the table size limits

type WriterRateLimit

type WriterRateLimit struct {
	Writer    string    `json:"writer"`
	RateLimit RateLimit `json:"rate-limit"`
}

WriterRateLimit represents the limit for a particular writer

type WriterRateLimits

type WriterRateLimits struct {
	Global  RateLimit         `json:"global"`
	Writers []WriterRateLimit `json:"writers"`
}

WriterRateLimits represents all of the writer limits

Jump to

Keyboard shortcuts

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