redis

package
v0.0.0-...-f90eb3b Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2025 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache interface {
	Set(ctx context.Context, key string, value string, ttl time.Duration) error
	Get(ctx context.Context, key string) (string, error)
	Delete(ctx context.Context, key string) error
}

type Client

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

func NewRedisClient

func NewRedisClient(opts ...Option) *Client

func (*Client) Close

func (r *Client) Close() error

func (*Client) Delete

func (r *Client) Delete(ctx context.Context, key string) error

func (*Client) Get

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

func (*Client) Set

func (r *Client) Set(ctx context.Context, key string, value string, ttl time.Duration) error

type Option

type Option func(client *Client)

Option -.

func Addr

func Addr(addr string) Option

Addr -.

func Db

func Db(db int) Option

Db -.

Jump to

Keyboard shortcuts

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