Documentation ¶
Index ¶
- Constants
- Variables
- func Module() dep.Module
- type Client
- func (c *Client) GetAny(ctx context.Context, key string, valuePtr any) error
- func (c *Client) GetBytes(ctx context.Context, key string) ([]byte, error)
- func (c *Client) GetString(ctx context.Context, key string) (string, error)
- func (c *Client) GetTTL(ctx context.Context, key string) (*time.Duration, error)
- func (c *Client) Key(args ...string) string
- func (c *Client) Ping(ctx context.Context) error
- func (c *Client) SetAny(ctx context.Context, key string, value any) error
- func (c *Client) SetBytes(ctx context.Context, key string, value []byte) error
- func (c *Client) SetString(ctx context.Context, key, value string) error
- func (c *Client) SetTTL(ctx context.Context, key string, ttl time.Duration) error
- type Configuration
- type ServerConfiguration
Constants ¶
View Source
const ( ModeLocal = "local" ModeSentinel = "sentinel" ModeCluster = "cluster" )
Variables ¶
View Source
var ( ConfMode = config.Key("redis", "mode") ConfAddr = config.Key("redis", "addr") ConfDatabase = config.Key("redis", "database") ConfUsername = config.Key("redis", "username") ConfPassword = config.Key("redis", "password") )
View Source
var (
ModuleName = dep.Name("wk", "redis")
)
Functions ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
type Configuration ¶
type Configuration struct { Mode string Servers []ServerConfiguration }
func ConfigFrom ¶
Click to show internal directories.
Click to hide internal directories.