cache

package
v0.0.0-...-bfc4fd5 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CachedCollection

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

func NewCachedCollection

func NewCachedCollection(collection app.LinksCollectionInterface, cache LinksCacheInterface) *CachedCollection

func (*CachedCollection) GenerateKey

func (c *CachedCollection) GenerateKey(URL string) (string, error)

func (*CachedCollection) GenerateKeys

func (c *CachedCollection) GenerateKeys(URLs []string) (map[string]string, error)

func (*CachedCollection) GetURL

func (c *CachedCollection) GetURL(key string) (string, error)

func (*CachedCollection) GetURLs

func (c *CachedCollection) GetURLs(keys []string) (map[string]string, error)

type CachedEntry

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

type FrequencyEntry

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

func NewFrequencyEntry

func NewFrequencyEntry(frequency int) *FrequencyEntry

type LFUCache

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

func NewLFUCache

func NewLFUCache(capacity int) *LFUCache

func (*LFUCache) Get

func (c *LFUCache) Get(key string) (interface{}, bool, error)

func (*LFUCache) Put

func (c *LFUCache) Put(key string, value interface{}) error

type LinksCacheInterface

type LinksCacheInterface interface {
	Get(string) (interface{}, bool, error)
	Put(string, interface{}) error
}

type RedisCache

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

func NewRedisCache

func NewRedisCache(rdb *redis.Client) *RedisCache

func (*RedisCache) Get

func (c *RedisCache) Get(key string) (interface{}, bool, error)

func (*RedisCache) Put

func (c *RedisCache) Put(key string, value interface{}) error

Jump to

Keyboard shortcuts

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