cache

package
v0.0.0-...-d614328 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2023 License: MIT Imports: 1 Imported by: 4

Documentation

Overview

Package cache implements various types of interfaces.Cacher

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Redis

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

Redis implements a Redis cache with basic key/values

func NewRedis

func NewRedis(endpoint string, database int) (*Redis, error)

NewRedis creates a new instance of a Redis queue endpoint is the full URL of the Redis endpoint database is the Redis database number to use popTimeout is the time a BLPOP call will wait before continuing

func (*Redis) Connect

func (cache *Redis) Connect() error

Connect to a Redis instance

func (*Redis) Delete

func (cache *Redis) Delete(key string) error

Delete a key

func (*Redis) Disconnect

func (cache *Redis) Disconnect() error

Disconnect from a Redis instance

func (*Redis) GetFloat64

func (cache *Redis) GetFloat64(key string) (float64, error)

Get an float value at key

func (*Redis) IncrementBy

func (cache *Redis) IncrementBy(key string, value int64) error

IncrementBy increments the value at key by the given value

func (*Redis) Set

func (cache *Redis) Set(key string, value interface{}) error

Set a float value at key

Jump to

Keyboard shortcuts

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