mem

package
v0.6.8 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Get

func Get(s *Store) *writer

Get is used to retrieve the in-memory store created at startup

Types

type Store

type Store struct {

	// MaxAge is the implementation of cache.MaxAge for use during trimming old key-value pairs
	MaxAge cache.MaxAge
	// contains filtered or unexported fields
}

Store implements cache.Store

func New

func New(s *Store) *Store

New will initialize a new in-memory store This is not persistent through reboots and should be used for short lived tasks.

func (*Store) Purge

func (s *Store) Purge() error

Purge clears the entire in-memory store. This function should only be used when stopping the service. If you need to flush the store without stopping it you can call this method directly. This will never return an error.

func (*Store) Trim

func (s *Store) Trim()

Trim is used for trimming keys older then the MaxAge. It is called by the caches trim worker. This can be called directly if needed.

func (*Store) Type

func (s *Store) Type() string

Type is the implementation from cache to get the store type

Jump to

Keyboard shortcuts

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