Documentation
¶
Overview ¶
Package valkey is a Valkey (Redis protocol) connection as a dependency: a configuration section, a client instrumented with the service's OpenTelemetry providers, a PING probe and a close.
type Config struct {
config.Backplane `json:"backplane"`
Cache valkey.Config `json:"cache"` // GREETER_CACHE_ADDR, ...
}
cache := deps.NewDependency(root, valkey.New(cfg.Cache), deps.Name("cache"))
err := cache.Get().Do(ctx, cache.Get().B().Set().Key("k").Value("v").Build()).Error()
The address is a seed: a cluster is discovered from it.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNoAddr = errors.New("valkey: addr is required")
ErrNoAddr: the section has no address.
Functions ¶
Types ¶
type Client ¶
Client is valkey-go's client: commands are built with B() and sent with Do, DoMulti or DoCache.
type Config ¶
type Config struct {
// Addr is host:port of a node.
Addr string `json:"addr,omitempty"`
Username string `json:"username,omitempty"`
Password config.Secret `json:"password,omitempty"`
// DB is the logical database (standalone only).
DB int64 `json:"db" schemapb:"default=0;gte=0;lte=15"`
TLS config.TLS `json:"tls"`
}
Config is the connection's section.
Click to show internal directories.
Click to hide internal directories.