redis

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2023 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 interface {
	// Get runs the redis GET command
	Get(key string) (string, error)
	// Set runs the redis SET command, to set an expiration, use the SetEX command
	Set(key string, value interface{}) error
	// SetEX runs the redis SETEX command
	SetEX(key string, value interface{}, expiration time.Duration) error
	// Close closes the client, releasing any open resources
	Close() error
}

Client is the interface for redis client

func NewClient

func NewClient(ctx context.Context, config Config) (Client, error)

NewClient creates a new redis client

type Config

type Config struct {
	Addr string
}

Config is the configuration for redis client

Jump to

Keyboard shortcuts

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