redis

package
v1.0.0-dev.63 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2024 License: MIT Imports: 3 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(cache *redis.Client, options *Options) *Client

func (*Client) Del

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

func (*Client) Get

func (c *Client) Get(ctx context.Context, key string) (data []byte, err error)

func (*Client) Set

func (c *Client) Set(ctx context.Context, key string, data []byte) (err error)

type Cluster

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

func NewCluster

func NewCluster(cache *redis.ClusterClient, options *Options) *Cluster

func (*Cluster) Del

func (c *Cluster) Del(ctx context.Context, key string) error

func (*Cluster) Get

func (c *Cluster) Get(ctx context.Context, key string) (data []byte, err error)

func (*Cluster) Set

func (c *Cluster) Set(ctx context.Context, key string, data []byte) (err error)

type Options

type Options struct {
	TTL time.Duration `config:"ttl"`
}

Options represents cache options.

Jump to

Keyboard shortcuts

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