docker

package
v0.0.3 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Command

type Command struct {
	Image     string
	Env       []Env
	BindPorts []Port
}

type Container

type Container interface {
	ID() string
	HostName() string
	Status() Status
	RunD(ctx context.Context) error
	Destroy(ctx context.Context) error
}

func NewContainer

func NewContainer(ctx context.Context, command *Command) (Container, error)

type Env

type Env struct {
	Key   string
	Value string
}

type ImagePullWriter

type ImagePullWriter interface {
	Write(p []byte) (n int, err error)
}

func NewImagePullWriter

func NewImagePullWriter() ImagePullWriter

type MySQLContainer

type MySQLContainer interface {
	// Config Information
	HostName() string
	Port() string
	User() string
	Password() string
	Database() string
	DSN() string
	Connection() (*sql.DB, error)

	// Container Control
	Start(ctx context.Context) error
	Destroy(ctx context.Context) error
}

func NewMySQLContainer

func NewMySQLContainer(ctx context.Context, database string) (MySQLContainer, error)

type Port

type Port struct {
	HostPort   string
	TargetPort string
	Protocol   string
}

type Status

type Status string
const (
	Created Status = "created"
	Prepare Status = "prepare"
	Running Status = "running"
)

Jump to

Keyboard shortcuts

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