rediscc

package module
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: May 13, 2025 License: MIT Imports: 4 Imported by: 0

README

rediscc

The rediscc package provides a simple and efficient way to manage multiple Redis connections in Go projects. This module abstracts the configuration and connection setup, allowing developers to focus on directly interacting with collections and documents.

Key Features:
  • Enables the instantiation of multiple independent Redis connections.
  • Simplifies connection management with configurable structures.
  • Provides direct access to collections within a database.
  • Fully compatible with standard Redis operations such as inserts, queries, updates, and deletions.

Install
go get github.com/codecraftkit/rediscc
Usage

Here’s a practical example of how to use the rediscc package:

package main

import (
	"fmt"
	"context"
	"github.com/codecraftkit/rediscc"
)

func main() {

	//TODO
	
}

Why Use rediscc?

Modularity: Ideal for projects requiring multiple connections to different databases. Ease of Use: Reduces the initial complexity of setting up Redis connections. Seamless Integration: Compatible with the official Redis driver for Go (mongo-driver).

Best Suited For:

Developers seeking a straightforward solution to manage Redis connections in applications that need to efficiently and cleanly interact with multiple databases.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RedisDataStore

type RedisDataStore struct {
	Debug bool
	// contains filtered or unexported fields
}

func Connect

func Connect(redisUri string, dbNumber string) (*RedisDataStore, error)

func (*RedisDataStore) Get added in v1.0.1

func (redisDataStore *RedisDataStore) Get(ctx context.Context, key string) *redis.StringCmd

func (*RedisDataStore) Publish added in v1.0.1

func (redisDataStore *RedisDataStore) Publish(ctx context.Context, channel string, payload interface{}) error

func (*RedisDataStore) Set added in v1.0.1

func (redisDataStore *RedisDataStore) Set(ctx context.Context, key string, value interface{}, expiration time.Duration) error

func (*RedisDataStore) SetWithExpiration added in v1.0.1

func (redisDataStore *RedisDataStore) SetWithExpiration(ctx context.Context, key string, value interface{}, expiration time.Duration) error

Jump to

Keyboard shortcuts

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