redisstate

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2026 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client wraps a Redis connection with a key prefix.

func New

func New(ctx context.Context, cfg *config.RedisConfig) (*Client, error)

New parses the config, connects, and verifies with a PING.

func TestClient

func TestClient(t *testing.T, addr string) *Client

TestClient creates a redisstate.Client connected to the given addr (typically miniredis) with no authentication. Exported so session/registry/server test packages can use it.

func (*Client) Close

func (c *Client) Close() error

Close closes the underlying Redis connection.

func (*Client) Key

func (c *Client) Key(parts ...string) string

Key returns the prefixed key for the given components. Key("session", "abc") -> "blockyard:session:abc"

func (*Client) Ping

func (c *Client) Ping(ctx context.Context) error

Ping checks Redis connectivity.

func (*Client) Prefix

func (c *Client) Prefix() string

Prefix returns the configured key prefix.

func (*Client) Redis

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

Redis returns the underlying go-redis client for direct use by store implementations.

Jump to

Keyboard shortcuts

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