redisdb

package module
v0.0.0-...-8f6edbe Latest Latest
Warning

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

Go to latest
Published: May 30, 2023 License: Apache-2.0 Imports: 5 Imported by: 13

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Connector

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

Connector - Implements a Redis connector

func NewConnector

func NewConnector(addr string, table int) (rc *Connector, err error)

NewConnector - Creates and initialize a Redis connector

func (*Connector) DBFlush

func (rc *Connector) DBFlush(module string) error

DBFlush - Empty DB

func (*Connector) DelEntry

func (rc *Connector) DelEntry(key string) error

DelEntry - delete an existing entry from DB

func (*Connector) EntryExists

func (rc *Connector) EntryExists(key string) bool

EntryExists - true if entry exists; false otherwise

func (*Connector) ForEachEntry

func (rc *Connector) ForEachEntry(keyMatchStr string, entryHandler func(string, map[string]string, interface{}) error, userData interface{}) error

ForEachEntry - Search for matching keys and run handler for each entry

func (*Connector) ForEachJSONEntry

func (rc *Connector) ForEachJSONEntry(keyMatchStr string, entryHandler func(string, string, interface{}) error, userData interface{}) error

func (*Connector) ForEachKey

func (rc *Connector) ForEachKey(keyMatchStr string, keyHandler func(string, interface{}) error, userData interface{}) error

ForEachKey - Search for matching keys and run handler for each key

func (*Connector) GetEntry

func (rc *Connector) GetEntry(key string) (map[string]string, error)

GetEntry - Retrieve key values

func (*Connector) JSONDelEntry

func (rc *Connector) JSONDelEntry(key string, path string) error

JSONDelEntry - delete an existing entry from DB

func (*Connector) JSONGetEntry

func (rc *Connector) JSONGetEntry(key string, path string) (string, error)

JSONGetEntry - Retrieve entry from DB

func (*Connector) JSONSetEntry

func (rc *Connector) JSONSetEntry(key string, path string, json string) error

JSONSetEntry - update existing entry from DB or create a new one if it doesnt't exist

func (*Connector) Listen

func (rc *Connector) Listen(handler func(string, string)) error

Listen - Wait for subscribed events

func (*Connector) Publish

func (rc *Connector) Publish(channel string, message string) error

Publish - Publish message to channel

func (*Connector) SetEntry

func (rc *Connector) SetEntry(key string, fields map[string]interface{}) error

SetEntry - Update existing entry or create new entry if it does not exist

func (*Connector) StopListen

func (rc *Connector) StopListen()

StopListen - Stop the listening goroutine

func (*Connector) Subscribe

func (rc *Connector) Subscribe(channels ...string) error

Subscribe - Register as a listener for provided channels

func (*Connector) Unsubscribe

func (rc *Connector) Unsubscribe(channels ...string) error

Unsubscribe - Unregister as a listener for provided channels

Jump to

Keyboard shortcuts

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