redisTools

package
v0.0.15 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package redisTools provides a wrapper functions for Redis database interactions.

REQUIRED VARIABLES: (SET ON INIT)

RedisEncryptionKey string (If using encryption)

RedisApplicationConfiguration struct {
	Addr     string `json:"address"`
	Password string `json:"password"`
	DB       int    `json:"db"`
}

Index

Constants

This section is empty.

Variables

View Source
var RedisEncryptionKey string

RedisEncryptionKey string for Redis encryption key

Functions

func Del

func Del(key string) error

Delete a key from Redis

func EGet

func EGet(key string) (string, error)

Get a value from Redis with encryption

func ESet

func ESet(key string, value string, expiration int) error

Set a value in Redis with encryption

func Get

func Get(key string) (string, error)

Get a value from Redis

func Keys

func Keys(pattern string) ([]string, error)

Keys returns all keys based on a pattern

func RedisOptions

func RedisOptions() *redis.Options

RedisOptions returns a new Redis options struct

func Set

func Set(key string, value string, expiration int) error

Set a value in Redis

func TestAccess

func TestAccess() error

TestAccess tests the access to Redis

func TestConnection

func TestConnection() error

TestConnection tests the connection to Redis

Types

type RedisConfiguration

type RedisConfiguration struct {
	Addr     string `json:"address"`
	Password string `json:"password"`
	DB       int    `json:"db"`
}

RedisConfiguration struct for Redis configuration

var RedisApplicationConfiguration RedisConfiguration

RedisApplicationConfiguration RedisConfiguration for Redis application configuration

Jump to

Keyboard shortcuts

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