cache

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2022 License: MIT Imports: 9 Imported by: 0

README

cache

Репозиторий кеша

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CacheConfig

type CacheConfig struct {
	Dir string
}

type CacheRepository

type CacheRepository struct {
	Err service.TypeError
	// contains filtered or unexported fields
}

func New

func New(config *CacheConfig, l *logger.Logger) (repo *CacheRepository, err error)

Новый сервис кеша

func (*CacheRepository) Delete

func (c *CacheRepository) Delete(key string) error

func (*CacheRepository) Exist

func (c *CacheRepository) Exist(key string) (bool, error)

func (*CacheRepository) Get

func (c *CacheRepository) Get(key string) (b *bytes.Buffer, err error)

func (*CacheRepository) RangePrefix

func (c *CacheRepository) RangePrefix(prefix string) (b []*bytes.Buffer, err error)

func (*CacheRepository) RegisterStruct

func (c *CacheRepository) RegisterStruct(value interface{})

Регистрация структур в кеше

func (*CacheRepository) RunGC

func (k *CacheRepository) RunGC(ctx context.Context, interval time.Duration, discardRatio float64)

func (*CacheRepository) Store

func (c *CacheRepository) Store(id string, data interface{}, ttl *time.Duration) error

Jump to

Keyboard shortcuts

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