caching

package
v0.0.0-...-eb336c4 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2022 License: MPL-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache interface {
	Set(string, interface{}, time.Duration) error
	Get(string) ([]byte, bool, error)
	SetVar(string, string, interface{}, time.Duration) error
	GetVar(string, string) ([]byte, bool, error)
}

type Redis

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

func InitRedis

func InitRedis(lg *zap.Logger) *Redis

func (*Redis) Get

func (r *Redis) Get(key string) ([]byte, bool, error)

func (*Redis) GetVar

func (r *Redis) GetVar(namespace, variable string) ([]byte, bool, error)

func (*Redis) Set

func (r *Redis) Set(key string, val interface{}, ttl time.Duration) error

func (*Redis) SetVar

func (r *Redis) SetVar(namespace, variable string, val interface{}, ttl time.Duration) error

type RedisConnectionData

type RedisConnectionData struct {
	Host     string `env:"REDIS_HOST"`
	Password string `env:"REDIS_PASSWORD"`
}

Jump to

Keyboard shortcuts

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