redis

package
v0.0.0-...-2c3b082 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2023 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

type DB struct {
	Counter *sillycounter.SillyCounter
	// contains filtered or unexported fields
}

func New

func New(ctx context.Context, addr, pass string) *DB

func (*DB) Close

func (db *DB) Close(_ context.Context) error

func (*DB) EnsureDB

func (db *DB) EnsureDB(_ context.Context) error

func (*DB) Healthy

func (db *DB) Healthy(ctx context.Context) bool

func (*DB) Open

func (db *DB) Open(ctx context.Context) error

func (*DB) TearDown

func (db *DB) TearDown(_ context.Context) error

type Model

type Model interface {
	// EnsureDB should be idempotent, making sure the db is in an expected state
	// ie tables/namespaces/indices etc should exist after a call. it should be safe to run at start, so not
	// dropping and recreating tables or such
	EnsureDB(context.Context) error
	// TearDown is destructive and purges all data, useful for integration tests
	TearDown(context.Context) error
	// Close closes anything needed
	Close(context.Context) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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