cacheristretto

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2023 License: AGPL-3.0, AGPL-3.0 Imports: 8 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CacheEntry

type CacheEntry struct {
	// contains filtered or unexported fields
}

CacheEntry - элемент кеширования

type Config

type Config struct {
	NumCounters        int64 `json:"num_counters,omitempty" yaml:"num_counters"`                 // number of keys to track frequency of (10M)
	MaxCost            int64 `json:"max_cost,omitempty" yaml:"max_cost"`                         // maximum cost of cache (1GB)
	BufferItems        int64 `json:"buffer_items,omitempty" yaml:"buffer_items"`                 // number of keys per Get buffer
	Metrics            bool  `json:"metrics,omitempty" yaml:"metrics"`                           // whether cache statistics are kept
	IgnoreInternalCost bool  `json:"ignore_internal_cost,omitempty" yaml:"ignore_internal_cost"` // cost of internally storing the value should be ignored
}

Config конфигурационные настройки

type Service

type Service struct {
	// contains filtered or unexported fields
}

Service represent a Ristretto Cache service

func New

func New(ctx context.Context, errCh chan<- error, cfg *Config) (*Service, error)

New returns a new Service

func (*Service) Clear

func (s *Service) Clear(entity *_meta.Entity)

func (*Service) ClearAll

func (s *Service) ClearAll()

func (*Service) CloseAll

func (s *Service) CloseAll()

func (*Service) Del

func (s *Service) Del(entity *_meta.Entity, key *_meta.Key, keyArgs ...interface{})

func (*Service) DelUnsafe

func (s *Service) DelUnsafe(entity *_meta.Entity, key *_meta.Key, keyArgs ...interface{})

func (*Service) Get

func (s *Service) Get(entity *_meta.Entity, key *_meta.Key, keepRLock bool, keyArgs ...interface{}) (*_meta.Object, bool)

func (*Service) GetUnsafe

func (s *Service) GetUnsafe(entity *_meta.Entity, key *_meta.Key, keepRLock bool, keyArgs ...interface{}) (*_meta.Object, bool)

func (*Service) Lock

func (s *Service) Lock(entity *_meta.Entity)

func (*Service) RLock

func (s *Service) RLock(entity *_meta.Entity)

func (*Service) RUnlock

func (s *Service) RUnlock(entity *_meta.Entity)

func (*Service) Set

func (s *Service) Set(key *_meta.Key, object *_meta.Object, keyArgs ...interface{}) bool

func (*Service) SetUnsafe

func (s *Service) SetUnsafe(key *_meta.Key, object *_meta.Object, keyArgs ...interface{}) bool

func (*Service) Shutdown

func (s *Service) Shutdown() (err error)

Shutdown shutting down service

func (*Service) Unlock

func (s *Service) Unlock(entity *_meta.Entity)

Jump to

Keyboard shortcuts

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