cache

package
v0.0.0-...-96f74f2 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2024 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 {
	Get(key string, result interface{}) error
	Set(key string, value interface{}) error
	Delete(key string) error
	Exists(key string) (bool, error)
	Invalidate(key string) error
	Close() error
	RateLimiter(ip string) (int64, error)
}

type Config

type Config struct {
	Addr       string
	Password   string
	DB         int
	Expiration time.Duration
}

type MyCache

type MyCache struct {
	Config
	// contains filtered or unexported fields
}

func New

func New(c Config) *MyCache

func (*MyCache) Close

func (c *MyCache) Close() error

func (*MyCache) Delete

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

func (*MyCache) Exists

func (c *MyCache) Exists(key string) (bool, error)

func (*MyCache) Get

func (c *MyCache) Get(key string, result interface{}) error

func (*MyCache) Invalidate

func (c *MyCache) Invalidate(pattern string) error

func (*MyCache) RateLimiter

func (c *MyCache) RateLimiter(ip string) (int64, error)

func (*MyCache) Set

func (c *MyCache) Set(key string, value interface{}) error

Jump to

Keyboard shortcuts

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