redis

package
v0.0.0-...-06621f0 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2024 License: MIT Imports: 6 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
}

func NewClient

func NewClient(cfg Config) *Client

func (*Client) Name

func (c *Client) Name() string

func (*Client) Ping

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

func (*Client) Shutdown

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

type Config

type Config struct {
	Addr     string `koanf:"addr" validate:"required"`
	Password string `koanf:"password" validate:"required"`
}

type KVRepository

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

func NewKVRepository

func NewKVRepository(client *Client) *KVRepository

func (*KVRepository) Delete

func (r *KVRepository) Delete(ctx context.Context, keys ...string) (delCount int64, err error)

func (*KVRepository) Get

func (r *KVRepository) Get(ctx context.Context, key string) (string, error)

func (*KVRepository) GetThenDelete

func (r *KVRepository) GetThenDelete(ctx context.Context, key string) (string, error)

func (*KVRepository) Set

func (r *KVRepository) Set(ctx context.Context, key, val string, exp time.Duration) error

Jump to

Keyboard shortcuts

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