Documentation
¶
Index ¶
- Constants
- type RedisDriver
- func (rd *RedisDriver) CreateContainer(ctx context.Context, c *client.Client, a mconfig.ContainerAllocation) (string, error)
- func (rd *RedisDriver) FlushAll(ctx context.Context, c *client.Client, container mconfig.ContainerInformation) error
- func (rd *RedisDriver) GetImage() string
- func (rd *RedisDriver) GetRequiredPortAmount() int
- func (rd *RedisDriver) GetUniqueId() string
- func (rd *RedisDriver) HandleInstruction(ctx context.Context, c *client.Client, container mconfig.ContainerInformation, ...) error
- func (rd *RedisDriver) Host(ctx *mconfig.Context) mconfig.EnvironmentValue
- func (rd *RedisDriver) Initialize(ctx context.Context, c *client.Client, container mconfig.ContainerInformation) error
- func (rd *RedisDriver) IsHealthy(ctx context.Context, c *client.Client, container mconfig.ContainerInformation) (bool, error)
- func (rd *RedisDriver) Load(data string) (mconfig.ServiceDriver, error)
- func (rd *RedisDriver) Password() mconfig.EnvironmentValue
- func (rd *RedisDriver) Port(ctx *mconfig.Context) mconfig.EnvironmentValue
- func (rd *RedisDriver) Save() (string, error)
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 ¶
func (rd *RedisDriver) Host(ctx *mconfig.Context) mconfig.EnvironmentValue
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 ¶
func (rd *RedisDriver) Port(ctx *mconfig.Context) mconfig.EnvironmentValue
Port returns allocated Redis port as env value.
func (*RedisDriver) Save ¶
func (rd *RedisDriver) Save() (string, error)
Click to show internal directories.
Click to hide internal directories.