memoryfood

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2023 License: Apache-2.0 Imports: 10 Imported by: 1 module, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

inmemory datastore implementation

Im-memory implementation of datastore interface

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrCanceled = errors.New("operation was canceled")
)
View Source
var InMemoryStoreClass = reflect.TypeOf((*implInMemoryStore)(nil))

Functions

func FromCache

func FromCache(name string, c *cache.Cache) *implInMemoryStore

func New

func New(name string, options ...Option) *implInMemoryStore

func NewDefault

func NewDefault(name string) *implInMemoryStore

func ObjectType

func ObjectType() reflect.Type

func OpenDatabase

func OpenDatabase(options ...Option) *cache.Cache

Types

type Config

type Config struct {
	DefaultExpiration time.Duration
	CleanupInterval   time.Duration
}

type Option

type Option interface {
	// contains filtered or unexported methods
}

Option configures memory storage using the functional options paradigm popularized by Rob Pike and Dave Cheney. If you're unfamiliar with this style, see https://commandcenter.blogspot.com/2014/01/self-referential-functions-and-design.html and https://dave.cheney.net/2014/10/17/functional-options-for-friendly-apis.

func WithCleanupInterval

func WithCleanupInterval(value time.Duration) Option

func WithDefaultExpiration

func WithDefaultExpiration(value time.Duration) Option

func WithNope

func WithNope() Option

option that do nothing

Jump to

Keyboard shortcuts

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