redis

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultPort is the default port for redis
	DefaultPort = 16379
	// DefaultUser is the default user for redis
	DefaultUser = ""
	// DefaultPass is the default password for redis
	DefaultPass = ""
)

Variables

This section is empty.

Functions

func Instances

func Instances(ctx context.Context) ([]database.Info, error)

Instances returns a list of running redis instances

Types

type Option

type Option func(*config) error

func WithHost

func WithHost(user, pass string, dbIndex int, port uint32) Option

func WithLabel added in v0.4.8

func WithLabel(label string) Option

func WithLogger

func WithLogger(logger io.Writer) Option

func WithVersion

func WithVersion(version string) Option

WithVersion applied selected postgres version to config

type Redis

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

Redis is a redis database

func New

func New(options ...Option) (*Redis, error)

New creates a new redis database instance

func (*Redis) CreateDB added in v0.4.0

CreateDB creates a new database

func (*Redis) RemoveDB added in v0.4.0

func (p *Redis) RemoveDB(ctx context.Context, uri string) error

RemoveDB removes a database by its uri

func (*Redis) Start

func (p *Redis) Start(ctx context.Context, detach bool) error

Start starts the database

func (*Redis) Stop

func (p *Redis) Stop(ctx context.Context) error

Stop stops the database

func (*Redis) URI

func (p *Redis) URI() string

URI returns the connection string for the database

func (*Redis) WaitForStart

func (p *Redis) WaitForStart(ctx context.Context, timeout time.Duration) error

WaitForStart waits for database to boot up

Jump to

Keyboard shortcuts

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