cache

package
v0.0.0-...-bba0b9a Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrKeyNotFound is an alias for redis.Nil
	ErrKeyNotFound = redis.Nil
)

Functions

func NewRedisStore

func NewRedisStore(addr string, password string) *redisCache

NewRedisStore returns a new cache.Store which is implemented by redis cache.

Types

type Store

type Store interface {
	// Get gets the record with id from the cache.
	Get(ctx context.Context, id int64) (*record.ShortURL, error)
	// Set sets the record with id to the cache.
	Set(ctx context.Context, id int64, record *record.ShortURL) error
}

Store defines the interface for url_shortener cache store.

Directories

Path Synopsis
Package mock_cache is a generated GoMock package.
Package mock_cache is a generated GoMock package.

Jump to

Keyboard shortcuts

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