docker

package
v1.16.0 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2025 License: MIT Imports: 2 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CacheConfig

type CacheConfig struct {
	ContainerID string
	Database    string
	Host        string
	Password    string
	Username    string
	Port        int
}

type CacheDriver

type CacheDriver interface {
	// Build a cache container, it doesn't wait for the cache to be ready, the Ready method needs to be called if
	// you want to check the container status.
	Build() error
	// Config get cache configuration.
	Config() CacheConfig
	// Fresh the cache.
	Fresh() error
	// Image gets the cache image.
	Image(image Image)
	// Ready checks if the cache is ready, the Build method needs to be called first.
	Ready() error
	// Reuse the existing cache container.
	Reuse(containerID string, port int) error
	// Shutdown the cache.
	Shutdown() error
}

type Database

type Database interface {
	DatabaseDriver
	// Migrate runs the database migrations.
	Migrate() error
	// Seed runs the database seeds.
	Seed(seeders ...seeder.Seeder) error
}

type DatabaseConfig

type DatabaseConfig struct {
	Driver      string
	Host        string
	Database    string
	Username    string
	Password    string
	ContainerID string
	Port        int
}

type DatabaseDriver

type DatabaseDriver interface {
	// Build a database container, it doesn't wait for the database to be ready, the Ready method needs to be called if
	// you want to check the container status.
	Build() error
	// Config get database configuration.
	Config() DatabaseConfig
	// Database returns a new instance with a new database, the Build method needs to be called first.
	Database(name string) (DatabaseDriver, error)
	// Driver gets the database driver name.
	Driver() string
	// Fresh the database.
	Fresh() error
	// Image gets the database image.
	Image(image Image)
	// Ready checks if the database is ready, the Build method needs to be called first.
	Ready() error
	// Reuse the existing database container.
	Reuse(containerID string, port int) error
	// Shutdown the database.
	Shutdown() error
}

type Image

type Image struct {
	Cmd          []string
	Env          []string
	ExposedPorts []string
	Repository   string
	Tag          string
	Args         []string
}

type ImageConfig

type ImageConfig struct {
	ContainerID  string
	ExposedPorts []string
}

type ImageDriver

type ImageDriver interface {
	// Build the image.
	Build() error
	// Config gets the image configuration.
	Config() ImageConfig
	// Ready checks if the image is ready by the given function until the given duration, default is 1 minute.
	Ready(func() error, ...time.Duration) error
	// Shutdown the image.
	Shutdown() error
}

Jump to

Keyboard shortcuts

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