storage

package
v0.0.0-...-293b262 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Storage

type Storage struct {
	Client *redis.Client
}

func NewStorage

func NewStorage(host string, port string, password string) (storage *Storage, err error)

func (*Storage) CloseConnection

func (s *Storage) CloseConnection() (err error)

func (*Storage) Expire

func (s *Storage) Expire(key string, expiration time.Duration) (err error)

func (*Storage) Get

func (s *Storage) Get(key string) (value string, err error)

func (*Storage) GetArticleCache

func (s *Storage) GetArticleCache(key string) (title string, body string, creationDate string, username string, err error)

func (*Storage) GetDel

func (s *Storage) GetDel(key string) (value string, err error)

func (*Storage) GetUserCache

func (s *Storage) GetUserCache(key string) (name string, err error)

func (*Storage) SetArticleCache

func (s *Storage) SetArticleCache(key string, title string, body string, creationDate string, username string) (err error)

func (*Storage) SetEx

func (s *Storage) SetEx(key string, value string, expiration time.Duration) (err error)

func (*Storage) SetUserCache

func (s *Storage) SetUserCache(key string, name string) (err error)

func (*Storage) TTL

func (s *Storage) TTL(key string) (ttl time.Duration, err error)

Jump to

Keyboard shortcuts

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