Dagger
Search

homerun

It exposes a Redis service (optionally password-protected), a randomly
generated password helper, an interactive redis-cli container, a one-shot
connectivity probe, and a `RunTestWithRedis` runner that wires a Redis
service into a Go test container — all without requiring an external Redis.

Installation

dagger install github.com/stuttgart-things/dagger/homerun@v0.129.4

Entrypoint

Return Type
Homerun
Example
dagger -m github.com/stuttgart-things/dagger/homerun@ad38e597157fa216aeeedca4210455c91f1feb61 call \
func (m *MyModule) Example() *dagger.Homerun  {
	return dag.
			Homerun()
}
@function
def example() -> dagger.Homerun:
	return (
		dag.homerun()
	)
@func()
example(): Homerun {
	return dag
		.homerun()
}

Types

Homerun 🔗

generatePassword() 🔗

GeneratePassword generates a random password of specified length

Useful for creating secure passwords for Redis or other services

Return Type
String !
Arguments
NameTypeDefault ValueDescription
lengthInteger 16No description provided
Example
dagger -m github.com/stuttgart-things/dagger/homerun@ad38e597157fa216aeeedca4210455c91f1feb61 call \
 generate-password
func (m *MyModule) Example(ctx context.Context) string  {
	return dag.
			Homerun().
			Generatepassword(ctx)
}
@function
async def example() -> str:
	return await (
		dag.homerun()
		.generatepassword()
	)
@func()
async example(): Promise<string> {
	return dag
		.homerun()
		.generatePassword()
}

redisCli() 🔗

RedisCli opens an interactive redis-cli shell connected to a Redis service

This is useful for debugging and manual interaction with Redis

Return Type
Container !
Arguments
NameTypeDefault ValueDescription
versionString "7.2.0-v18"No description provided
passwordString -No description provided
Example
dagger -m github.com/stuttgart-things/dagger/homerun@ad38e597157fa216aeeedca4210455c91f1feb61 call \
 redis-cli
func (m *MyModule) Example() *dagger.Container  {
	return dag.
			Homerun().
			Rediscli()
}
@function
def example() -> dagger.Container:
	return (
		dag.homerun()
		.rediscli()
	)
@func()
example(): Container {
	return dag
		.homerun()
		.redisCli()
}

redisService() 🔗

RedisService creates a Redis service with optional password protection

Returns a Redis service that can be bound to other containers for testing

Return Type
Service !
Arguments
NameTypeDefault ValueDescription
versionString "7.2.0-v18"No description provided
passwordString -No description provided
Example
dagger -m github.com/stuttgart-things/dagger/homerun@ad38e597157fa216aeeedca4210455c91f1feb61 call \
 redis-service
func (m *MyModule) Example() *dagger.Service  {
	return dag.
			Homerun().
			Redisservice()
}
@function
def example() -> dagger.Service:
	return (
		dag.homerun()
		.redisservice()
	)
@func()
example(): Service {
	return dag
		.homerun()
		.redisService()
}

runRedis() 🔗

RunRedis starts a Redis service that can be accessed with ‘dagger up’

Example: dagger call -m homerun run-redis –port 6379 –password “mypass” up

Return Type
Service !
Arguments
NameTypeDefault ValueDescription
versionString "7.2.0-v18"No description provided
portInteger 6379No description provided
passwordString -No description provided
Example
dagger -m github.com/stuttgart-things/dagger/homerun@ad38e597157fa216aeeedca4210455c91f1feb61 call \
 run-redis
func (m *MyModule) Example() *dagger.Service  {
	return dag.
			Homerun().
			Runredis()
}
@function
def example() -> dagger.Service:
	return (
		dag.homerun()
		.runredis()
	)
@func()
example(): Service {
	return dag
		.homerun()
		.runRedis()
}

runTestWithRedis() 🔗

Return Type
String !
Arguments
NameTypeDefault ValueDescription
sourceDirectory !-No description provided
goVersionString "1.25.4"No description provided
redisVersionString "7.2.0-v18"No description provided
testPathString !-No description provided
Example
dagger -m github.com/stuttgart-things/dagger/homerun@ad38e597157fa216aeeedca4210455c91f1feb61 call \
 run-test-with-redis --source DIR_PATH --test-path string
func (m *MyModule) Example(ctx context.Context, source *dagger.Directory, testPath string) string  {
	return dag.
			Homerun().
			Runtestwithredis(ctx, source, testPath)
}
@function
async def example(source: dagger.Directory, testpath: str) -> str:
	return await (
		dag.homerun()
		.runtestwithredis(source, testpath)
	)
@func()
async example(source: Directory, testPath: string): Promise<string> {
	return dag
		.homerun()
		.runTestWithRedis(source, testPath)
}

testRedisConnection() 🔗

TestRedisConnection tests if Redis service is reachable and working

This is useful to verify the Redis service is up and accessible from the CLI

Return Type
String !
Arguments
NameTypeDefault ValueDescription
versionString "7.2.0-v18"No description provided
passwordString -No description provided
Example
dagger -m github.com/stuttgart-things/dagger/homerun@ad38e597157fa216aeeedca4210455c91f1feb61 call \
 test-redis-connection
func (m *MyModule) Example(ctx context.Context) string  {
	return dag.
			Homerun().
			Testredisconnection(ctx)
}
@function
async def example() -> str:
	return await (
		dag.homerun()
		.testredisconnection()
	)
@func()
async example(): Promise<string> {
	return dag
		.homerun()
		.testRedisConnection()
}