redis

package
v0.0.0-...-a6f2505 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNil = errors.New("(nil)")

ErrNil indicates that a reply value is nil.

Functions

This section is empty.

Types

type Cache

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

Cache describes connection to Cache server

func New

func New(ctx context.Context, cfg Config) (*Cache, error)

New returns the initialized Redis object

func (*Cache) AddItemToSet

func (c *Cache) AddItemToSet(key string, value string) error

func (*Cache) Check

func (c *Cache) Check() error

Check checks if connection exists

func (*Cache) EXPIRE

func (c *Cache) EXPIRE(key string, seconds int) error

func (*Cache) Exists

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

func (*Cache) IsItemInSet

func (c *Cache) IsItemInSet(key string, value string) (bool, error)

func (*Cache) Read

func (c *Cache) Read(key string) (string, error)

func (*Cache) ReadSet

func (c *Cache) ReadSet(key string) ([]string, error)

func (*Cache) ReadWithTime

func (c *Cache) ReadWithTime(key string) (v string, t int64, err error)

func (*Cache) RemoveItemFromSet

func (c *Cache) RemoveItemFromSet(key string, value string) error

func (*Cache) Write

func (c *Cache) Write(key, value string) error

func (*Cache) WriteWithTTL

func (c *Cache) WriteWithTTL(key, value string, ttl int) error

func (*Cache) WriteWithTime

func (c *Cache) WriteWithTime(key, value string) error

type Config

type Config struct {
	Addr               string
	StatsWriteInterval time.Duration
	IdleTimeout        time.Duration // Close connections after remaining idle for this duration.
	MaxActive          int           // When zero, there is no limit on the number of connections in the pool.
	MaxIdle            int
}

Jump to

Keyboard shortcuts

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