pantry

package module
v0.42.0 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2024 License: MIT Imports: 4 Imported by: 1

README

Pantry

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Pantry

type Pantry[T any] struct {
	// contains filtered or unexported fields
}

func New

func New[T any](ctx context.Context, expiration time.Duration) *Pantry[T]

func (*Pantry[T]) All added in v0.40.0

func (pantry *Pantry[T]) All() iter.Seq2[string, T]

func (*Pantry[T]) Get

func (pantry *Pantry[T]) Get(key string) (T, bool)

func (*Pantry[T]) IsEmpty added in v0.2.0

func (pantry *Pantry[T]) IsEmpty() bool

func (*Pantry[T]) Keys added in v0.40.0

func (pantry *Pantry[T]) Keys() iter.Seq[string]

func (*Pantry[T]) Remove

func (pantry *Pantry[T]) Remove(key string)

func (*Pantry[T]) Set

func (pantry *Pantry[T]) Set(key string, value T)

func (*Pantry[T]) Values added in v0.40.0

func (pantry *Pantry[T]) Values() iter.Seq[T]

Jump to

Keyboard shortcuts

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