redis

package
v1.295.0 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2024 License: MIT Imports: 16 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

Module for fx.

Functions

func IsEnabled added in v1.156.0

func IsEnabled(cfg *Config) bool

IsEnabled for redis.

func NewCache

func NewCache(opts *cache.Options) *cache.Cache

NewCache from config. The cache is based on https://github.com/go-redis/cache

func NewClient added in v1.66.0

func NewClient(params ClientParams) gr.Client

NewClient for redis.

func NewOptions

func NewOptions(params OptionsParams) (*cache.Options, error)

NewOptions for redis.

func NewRingOptions added in v1.66.0

func NewRingOptions(cfg *Config) (*redis.RingOptions, error)

NewRingOptions for redis.

Types

type ClientParams added in v1.66.0

type ClientParams struct {
	fx.In

	Lifecycle   fx.Lifecycle
	RingOptions *redis.RingOptions
	Tracer      trace.Tracer
	Logger      *zap.Logger
}

ClientParams for redis.

type Config

type Config struct {
	Compressor string            `yaml:"compressor,omitempty" json:"compressor,omitempty" toml:"compressor,omitempty"`
	Encoder    string            `yaml:"encoder,omitempty" json:"encoder,omitempty" toml:"encoder,omitempty"`
	Addresses  map[string]string `yaml:"addresses,omitempty" json:"addresses,omitempty" toml:"addresses,omitempty"`
	URL        string            `yaml:"url,omitempty" json:"url,omitempty" toml:"url,omitempty"`
}

Config for redis.

func (*Config) GetURL added in v1.194.0

func (c *Config) GetURL() (string, error)

GetURL for redis.

type OptionsParams added in v1.54.0

type OptionsParams struct {
	fx.In

	Client     gr.Client
	Config     *Config
	Encoder    *encoding.Map
	Pool       *sync.BufferPool
	Compressor *compress.Map
}

OptionsParams for redis.

Directories

Path Synopsis
telemetry

Jump to

Keyboard shortcuts

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