decorators

package
v0.0.0-...-02374a7 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnforceSizeLimit

func EnforceSizeLimit(delegate backends.Backend, maxSize int) backends.Backend

EnforceSizeLimit rejects payloads over a max size. If a payload is too large, the Put() function will return a BadPayloadSize error.

func LimitTTLs

func LimitTTLs(delegate backends.Backend, maxTTLSeconds int) backends.Backend

LimitTTLs wraps the delegate and makes sure that it never gets TTLs which exceed the max. or are less than zero.

func LogMetrics

func LogMetrics(backend backends.Backend, m *metrics.Metrics) backends.Backend

Types

type BadPayloadSize

type BadPayloadSize struct {
	Limit int
	Size  int
}

func (*BadPayloadSize) Error

func (p *BadPayloadSize) Error() string

Jump to

Keyboard shortcuts

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