Documentation ¶
Index ¶
- Variables
- func IsEnabled(cfg *Config) bool
- func NewCache(opts *cache.Options) *cache.Cache
- func NewClient(params ClientParams) gr.Client
- func NewOptions(params OptionsParams) (*cache.Options, error)
- func NewRingOptions(cfg *Config) (*redis.RingOptions, error)
- type ClientParams
- type Config
- type OptionsParams
Constants ¶
This section is empty.
Variables ¶
View Source
var Module = fx.Options( fx.Provide(NewClient), fx.Provide(NewOptions), fx.Provide(NewCache), fx.Provide(NewRingOptions), fx.Invoke(metrics.Register), )
Module for fx.
Functions ¶
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
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"` Marshaller string `yaml:"marshaller,omitempty" json:"marshaller,omitempty" toml:"marshaller,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.
Click to show internal directories.
Click to hide internal directories.