redis

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2022 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// TTL specifies how long messages should be kept in storage.
	TTL time.Duration
	// Address specifies Redis server address as "host:port".
	Address string
	// Password specifies Redis server password.
	Password string
	// DB is the Redis database number.
	DB int
}

Config contains configuration parameters for Redis.

type Redis

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

Redis provides storage mechanism for store.EventStore. It uses a Redis database to store events.

func New

func New(cfg Config) (*Redis, error)

New returns a new instance of Redis.

func (*Redis) Add

func (r *Redis) Add(ctx context.Context, author []byte, evt *messages.Event) (err error)

Add implements the store.Storage interface.

func (*Redis) Get

func (r *Redis) Get(ctx context.Context, typ string, idx []byte) (evts []*messages.Event, err error)

Get implements the store.Storage interface.

Jump to

Keyboard shortcuts

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