redis

package
v0.0.0-...-c600c60 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2024 License: BSD-3-Clause Imports: 4 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 is the redis client.

func NewClient

func NewClient(cfg Configuration) *Client

NewClient creates a new redis client.

func (*Client) Get

func (c *Client) Get(ctx context.Context, key string) (string, error)

Get retrieves a value from cache.

func (*Client) Set

func (c *Client) Set(ctx context.Context, key string, value any, expiration time.Duration) error

Set saves a key/value pair on cache.

type Configuration

type Configuration struct {
	Addr     string
	Password string
	DB       int
}

Configuration contains redis client configurations.

Jump to

Keyboard shortcuts

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