state

package
v0.5.0-dev Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MaxKeyLen   = 4096
	MaxValueLen = 1 << 20 // 1 MiB

	DefaultTotalLimit = 64 << 20 // 64 MiB
)

Variables

This section is empty.

Functions

func ParseSize

func ParseSize(s string) (int64, error)

could move to a shared utils package but not necessary yet

Types

type Budget

type Budget struct {
	// contains filtered or unexported fields
}

func NewBudget

func NewBudget(limit int64) *Budget

type Store

type Store struct {
	// contains filtered or unexported fields
}

bounded string-to-string map

func NewStore

func NewStore(budget *Budget) *Store

func (*Store) Budget

func (s *Store) Budget() *Budget

func (*Store) Delete

func (s *Store) Delete(key string)

func (*Store) Get

func (s *Store) Get(key string) (string, bool)

func (*Store) Has

func (s *Store) Has(key string) bool

func (*Store) Set

func (s *Store) Set(key, value string) error

Jump to

Keyboard shortcuts

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