inmemorystorage

package module
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2022 License: Apache-2.0 Imports: 7 Imported by: 1

README

inmemorystorage

inmemorystorage

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrCanceled = errors.New("operation was canceled")
)

Functions

func FromCache

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

func New

func New(name string, options ...Option) storage.ManagedStorage

func NewDefault

func NewDefault(name string) storage.ManagedStorage

func OpenDatabase added in v1.4.3

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

Types

type Config

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

type Option added in v1.4.2

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 added in v1.4.2

func WithCleanupInterval(value time.Duration) Option

func WithDefaultExpiration added in v1.4.2

func WithDefaultExpiration(value time.Duration) Option

func WithNope added in v1.4.2

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