redis

package
v0.0.0-...-4561831 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// RSUCCESS is the success code returned by a Redis op
	RSUCCESS int64 = 1
	// RFAIL is the failure code returned by a Redis op
	RFAIL int64 = 0
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	DefaultDB *redis.Client
	DBOne     *redis.Client
}

Client stores essential client info

func CreateRedisClient

func CreateRedisClient() (*Client, error)

CreateRedisClient establishes connection to redis DB

func Init

func Init() (*Client, error)

Init initializes the redis clients

func InitForTesting

func InitForTesting() (*Client, error)

func (*Client) Close

func (c *Client) Close()

Close tries to close the 2 clients

func (*Client) DBOneDel

func (c *Client) DBOneDel(hostport string)

DBOneDel does Del on Default DB and logs results

func (*Client) DBOneSAdd

func (c *Client) DBOneSAdd(hostport, svcport string)

DBOneSAdd does SAdd on DB One and logs results

func (*Client) DBOneSRem

func (c *Client) DBOneSRem(hostport, svcport string)

DBOneSRem does SRem on DB One and logs results

func (*Client) DBOneSUnionStore

func (c *Client) DBOneSUnionStore(dest, src string)

DefaultDBSUnionStore does sunionstore on default db

func (*Client) DefaultDBDel

func (c *Client) DefaultDBDel(svcport string)

DefaultDBDel does Del on Default DB and logs results

func (*Client) DefaultDBSAdd

func (c *Client) DefaultDBSAdd(svcport, ipport string)

DefaulDBSAdd does SAdd on Default DB and logs results

func (*Client) DefaultDBSUnionStore

func (c *Client) DefaultDBSUnionStore(dest, src string)

DefaultDBSUnionStore does sunionstore on default db

func (*Client) Flush

func (c *Client) Flush() error

Flush flushes all of redis database

func (*Client) GetDBOneKeyValues

func (c *Client) GetDBOneKeyValues() map[string][]string

func (*Client) GetDefaultDBKeyValues

func (c *Client) GetDefaultDBKeyValues() map[string][]string

func (*Client) PrintAllKeys

func (c *Client) PrintAllKeys()

PrintAllKeys prints all the keys in the redis client. For debugging purposes etc

func (*Client) Terminate

func (c *Client) Terminate()

Terminate tries to flush the entire redis and close clients

Jump to

Keyboard shortcuts

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