memory

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2023 License: MIT Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMemoryCache

func NewMemoryCache(cfg Config) (mc cache.Cache)

func NewMemoryCounter

func NewMemoryCounter(cfg Config) (mc cache.Counter)

Types

type Config

type Config struct {
	EnableInitiativeClean bool `json:"enable_initiative_clean,omitempty" yaml:"enable_initiative_clean,omitempty" xml:"enable_initiative_clean,omitempty"`
	CleanIntervalSecond   int  `json:"clean_interval_second,omitempty" yaml:"clean_interval_second,omitempty" xml:"clean_interval_second,omitempty"`
	MaxCleanMicroSecond   int  `json:"max_clean_micro_second,omitempty" yaml:"max_clean_micro_second,omitempty" xml:"max_clean_micro_second,omitempty"`
	MaxCleanPercentage    int  `json:"max_clean_percentage,omitempty" yaml:"max_clean_percentage,omitempty" xml:"max_clean_percentage,omitempty"`
}

type Type

type Type string
const (
	Int    Type = "int"
	String Type = "string"
	Set    Type = "set"
	Hash   Type = "hash"
)

type ValueTypeNotMatchError

type ValueTypeNotMatchError struct {
	Want     Type
	Actually Type
}

func NewValueTypeNotMatchError

func NewValueTypeNotMatchError(want, actually Type) ValueTypeNotMatchError

func (ValueTypeNotMatchError) Error

func (e ValueTypeNotMatchError) Error() string

Jump to

Keyboard shortcuts

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