cache

package
v0.1.12 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ModeStandalone = "standalone"
	ModeCluster    = "cluster"
	ModeAuto       = "auto"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client added in v0.1.12

type Client struct {
	Connection goredis.UniversalClient
}

func CreateNewRedisClient

func CreateNewRedisClient(config RedisConfig) *Client

func (*Client) ClusterNodes added in v0.1.12

func (c *Client) ClusterNodes() *goredis.StringCmd

func (*Client) DeleteHash added in v0.1.12

func (c *Client) DeleteHash(key string, fields ...string) *goredis.IntCmd

func (*Client) DeleteListElements added in v0.1.12

func (c *Client) DeleteListElements(key string) *goredis.StringCmd

func (*Client) DeleteSet added in v0.1.12

func (c *Client) DeleteSet(key string) *goredis.StringCmd

func (*Client) DeleteString added in v0.1.12

func (c *Client) DeleteString(key string) *goredis.StringCmd

Works only with Redis >= 6.2.0, use `SetStringWithExpiry` with versions lower than 6.2

func (*Client) Get added in v0.1.12

func (c *Client) Get(key string) *goredis.StringCmd

func (*Client) GetHashVals added in v0.1.12

func (c *Client) GetHashVals(key string) *goredis.StringSliceCmd

func (*Client) GetListRange added in v0.1.12

func (c *Client) GetListRange(key string, start, end int64) *goredis.StringSliceCmd

func (*Client) GetSetMembers added in v0.1.12

func (c *Client) GetSetMembers(key string) *goredis.StringSliceCmd

func (*Client) Info added in v0.1.12

func (c *Client) Info() *goredis.StringCmd

func (*Client) Set added in v0.1.12

func (c *Client) Set(key, value string) *goredis.StatusCmd

func (*Client) SetAdd added in v0.1.12

func (c *Client) SetAdd(key string, members interface{}) *goredis.IntCmd

func (*Client) SetHash added in v0.1.12

func (c *Client) SetHash(key string, values interface{}) *goredis.IntCmd

func (*Client) SetListContents added in v0.1.12

func (c *Client) SetListContents(key string, values interface{}) *goredis.IntCmd

func (*Client) SetStringWithExpiry added in v0.1.12

func (c *Client) SetStringWithExpiry(key string, value string, expiration time.Duration) *goredis.StatusCmd

Using with versions lower than 6.2.0 to delete string after specified time

type RedisConfig added in v0.1.12

type RedisConfig struct {
	Enabled                            bool
	Url                                string
	Username                           string
	Password                           string
	OperationMode                      string
	MaxActiveConnections               int
	MaxIdleConnections                 int
	IdleTimeoutInSeconds               int
	CrashAppOnConnectionFailure        bool
	ConnectRetryIntervalInSeconds      int
	AutoExpireTopLevelKeysAfterSeconds int
	AppNamespace                       string
}

Jump to

Keyboard shortcuts

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