redis

package
v1.0.49 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RedisService

type RedisService struct {
	Client *redis.Client
}

func NewRedisService

func NewRedisService(ctx context.Context, address, password string, db int) *RedisService

NewRedisService creates a new instance of RedisService with the specified connection options.

It establishes a connection to the Redis server located at the given address using the provided password and database index. The function will log a fatal error if the connection cannot be established.

Parameters:

ctx - Context for managing request-scoped values, cancelation signals, and deadlines.
address - The address of the Redis server.
password - The password for authenticating with the Redis server.
db - The database index to select within the Redis server.

Returns:

A pointer to a newly created RedisService with an active Redis client.

Jump to

Keyboard shortcuts

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