cache

package
v0.0.0-...-bb2521d Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMemcachedCache

func NewMemcachedCache(server string) *memcached

Types

type Methods

type Methods interface {
	Set(key string, value interface{}, ttl time.Duration) error
	Get(key string) (interface{}, error)
	Delete(key string) error
	Clear()
}

func NewInMemoryCache

func NewInMemoryCache(Size int) Methods

func NewRedisCache

func NewRedisCache(opt *RedisOptions) Methods

type RedisOptions

type RedisOptions struct {
	Addr     string
	Network  string
	Username string
	DB       int
	Password string
}

type Rs

type Rs struct {
	Client *redis.Client
}

func (*Rs) Clear

func (c *Rs) Clear()

func (*Rs) Delete

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

func (*Rs) Get

func (c *Rs) Get(key string) (any, error)

func (*Rs) Set

func (c *Rs) Set(key string, value interface{}, ttl time.Duration) error

Jump to

Keyboard shortcuts

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