redis

package module
v0.0.0-...-2fd9363 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Connect

func Connect(cnf *Config) types.KVStore

Connect the redis with default database

Types

type Config

type Config struct {
	Host string `yaml:"host" env:"REDIS_HOST" env-description:"Redis host"`
	Port string `yaml:"port" env:"REDIS_PORT" env-description:"Redis port"`
	Pass string `env:"REDISPASS" env-description:"Redis user password"`
}

Config for redis connection TODO Set all default values

type Store

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

Store represent the Store model

func (*Store) Close

func (s *Store) Close() error

Close attaches the redis repository

func (*Store) Get

func (s *Store) Get(key string) (string, error)

Get attaches the redis repository and get the data

func (*Store) Set

func (s *Store) Set(key string, value interface{}, exp time.Duration) error

Set attaches the redis repository and set the data

Jump to

Keyboard shortcuts

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