Documentation
¶
Index ¶
- type CacheConfig
- type CacheRepository
- func (c *CacheRepository) Delete(key string) error
- func (c *CacheRepository) Exist(key string) (bool, error)
- func (c *CacheRepository) Get(key string) (b *bytes.Buffer, err error)
- func (c *CacheRepository) RangePrefix(prefix string) (b []*bytes.Buffer, err error)
- func (c *CacheRepository) RegisterStruct(value interface{})
- func (k *CacheRepository) RunGC(ctx context.Context, interval time.Duration, discardRatio float64)
- func (c *CacheRepository) Store(id string, data interface{}, ttl *time.Duration) error
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 ¶
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) 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{})
Регистрация структур в кеше
Click to show internal directories.
Click to hide internal directories.