cache

package
v0.0.0-...-d5a36d1 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2021 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Tokenize

func Tokenize(req *http.Request) (string, error)

Types

type Cache

type Cache interface {
	Get(key string) ([]byte, error)
	Set(key string, val []byte, expiry time.Duration) error
}

func New

func New(conf config.Config) (Cache, error)

type MemoryCache

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

func (*MemoryCache) Get

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

func (*MemoryCache) Set

func (c *MemoryCache) Set(key string, v []byte, _ time.Duration) error

TODO Implement exipire logic

type NoneCache

type NoneCache struct {
}

func (*NoneCache) Get

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

func (*NoneCache) Set

func (c *NoneCache) Set(_ string, _ []byte, _ time.Duration) error

type RedisCache

type RedisCache struct {
}

func (*RedisCache) Get

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

func (*RedisCache) Set

func (c *RedisCache) Set(key string, v []byte, expiry time.Duration) error

Jump to

Keyboard shortcuts

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