cache

package
v0.0.0-...-77d9c2d Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache interface {
	Set(key string, value []byte, expirationTime int) error
	Get(key string) ([]byte, error)
}

type InMemoryCache

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

func NewInMemoryCache

func NewInMemoryCache(capacity int) *InMemoryCache

func (*InMemoryCache) Get

func (c *InMemoryCache) Get(key string) ([]byte, error)

func (*InMemoryCache) Set

func (c *InMemoryCache) Set(key string, value []byte, expirationTime int) error

type MemcachedCache

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

func NewMemcachedCache

func NewMemcachedCache(server ...string) *MemcachedCache

func (*MemcachedCache) Get

func (c *MemcachedCache) Get(key string) ([]byte, error)

func (*MemcachedCache) Set

func (c *MemcachedCache) Set(key string, value []byte, expirationTime int) error

type RedisCache

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

func NewRedisCache

func NewRedisCache(addr, password string, db int) *RedisCache

func (*RedisCache) Get

func (c *RedisCache) Get(key string) ([]byte, error)

func (*RedisCache) Set

func (c *RedisCache) Set(key string, value []byte, expirationTime int) error

Jump to

Keyboard shortcuts

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