docker

package
v1.15.2-0...-ab139f2 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2025 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

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
	Port        int
	Database    string
	Username    string
	Password    string
	ContainerID string
}

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 {
	Env          []string
	ExposedPorts []string
	Repository   string
	Tag          string
	Args         []string
}

Jump to

Keyboard shortcuts

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