redis

package module
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RedisPassword = "redis"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type RedisDriver

type RedisDriver struct {
	Image string `json:"image"`
}

func NewDriver

func NewDriver(image string) *RedisDriver

NewDriver creates a new Redis service driver.

func (*RedisDriver) CreateContainer

func (rd *RedisDriver) CreateContainer(ctx context.Context, c *client.Client, a mconfig.ContainerAllocation) (string, error)

CreateContainer creates Redis container with password auth.

func (*RedisDriver) FlushAll

func (rd *RedisDriver) FlushAll(ctx context.Context, c *client.Client, container mconfig.ContainerInformation) error

FlushAll executes FLUSHALL with async to clear all Redis data.

func (*RedisDriver) GetImage

func (rd *RedisDriver) GetImage() string

func (*RedisDriver) GetRequiredPortAmount

func (rd *RedisDriver) GetRequiredPortAmount() int

func (*RedisDriver) GetUniqueId

func (rd *RedisDriver) GetUniqueId() string

func (*RedisDriver) HandleInstruction

func (rd *RedisDriver) HandleInstruction(ctx context.Context, c *client.Client, container mconfig.ContainerInformation, instruction mconfig.Instruction) error

For all clear instructions, flush everything away. Similar to other databases, but since we don't have schemas we flush everything.

func (*RedisDriver) Host

Host returns Redis host as static env value.

func (*RedisDriver) Initialize

func (rd *RedisDriver) Initialize(ctx context.Context, c *client.Client, container mconfig.ContainerInformation) error

Initialize does nothing. Redis needs no schema setup / create databases.

func (*RedisDriver) IsHealthy

func (rd *RedisDriver) IsHealthy(ctx context.Context, c *client.Client, container mconfig.ContainerInformation) (bool, error)

IsHealthy checks Redis readiness via redis-cli ping.

func (*RedisDriver) Load

func (rd *RedisDriver) Load(data string) (mconfig.ServiceDriver, error)

func (*RedisDriver) Password

func (rd *RedisDriver) Password() mconfig.EnvironmentValue

Password returns Redis password as static env value.

func (*RedisDriver) Port

Port returns allocated Redis port as env value.

func (*RedisDriver) Save

func (rd *RedisDriver) Save() (string, error)

Jump to

Keyboard shortcuts

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