redis

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package redis provides a Redis client and lifecycle shared by Tupic services.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Address  string `mapstructure:"address"  validate:"required"`
	Username string `mapstructure:"username"`
	Password string `mapstructure:"password"`
	DB       int    `mapstructure:"db"`
	Timeout  int    `mapstructure:"timeout"  validate:"required"`
}

Config carries Redis connection settings. Services can alias it in their own config structs.

func (Config) Validate

func (c Config) Validate() error

type Redis

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

func New

func New(cfg Config) (*Redis, *redis.Client, error)

func (*Redis) Client

func (r *Redis) Client() *redis.Client

func (*Redis) Start

func (r *Redis) Start(ctx context.Context, l logger.Logger, cfg Config) error

func (*Redis) Stop

func (r *Redis) Stop(l logger.Logger) error

Jump to

Keyboard shortcuts

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