Help us shape the future of Go! Take the 2026 Go Developer Survey

runners

package
v0.0.65 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2023 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ForwardLogs

func ForwardLogs(r io.ReadCloser, ws ...io.Writer)

func WrapStart

func WrapStart(cmd *exec.Cmd, writers ...io.Writer) error

func WrapStartDebug

func WrapStartDebug(ctx context.Context, cmd *exec.Cmd, _ io.Writer) error

Types

type ContainerInstance

type ContainerInstance struct {
	ID    string
	Name  string
	Image string
	Host  string
	Port  int
}

type CreateDockerInput

type CreateDockerInput struct {
	DockerImage
	ApplicationEndpointInstance *network.ApplicationEndpointInstance
}

type DockerImage

type DockerImage struct {
	Image string
}

type DockerOption

type DockerOption func(option *Option)

func WithCmd

func WithCmd(cmd ...string) DockerOption

func WithEnvironmentVariable

func WithEnvironmentVariable(key, value string) DockerOption

func WithVolume

func WithVolume(source, target string) DockerOption

type DockerRunner

type DockerRunner struct {
	Containers []*ContainerInstance
	// contains filtered or unexported fields
}

func NewDockerRunner

func NewDockerRunner(ctx context.Context, forwarder io.Writer) (*DockerRunner, error)

NewDockerRunner creates a new docker runner

func (*DockerRunner) ContainerReady

func (r *DockerRunner) ContainerReady(ctx context.Context, name string) (bool, error)

func (*DockerRunner) CreateContainer

func (r *DockerRunner) CreateContainer(ctx context.Context, input CreateDockerInput, opts ...DockerOption) error

func (*DockerRunner) EnsureImage

func (r *DockerRunner) EnsureImage(ctx context.Context, imageName string) error

func (*DockerRunner) IP

func (*DockerRunner) Start

func (r *DockerRunner) Start(ctx context.Context) error

func (*DockerRunner) StartContainer

func (r *DockerRunner) StartContainer(ctx context.Context, c *ContainerInstance) error

func (*DockerRunner) Stop

func (r *DockerRunner) Stop(ctx context.Context) error

type Option

type Option struct {
	Cmd     []string
	Volumes []VolumeMount
	Envs    []string
}

type Runner

type Runner struct {
	Name  string
	Bin   string
	Dir   string
	Args  []string
	Envs  []string
	Debug bool

	Wait bool

	Cmd *exec.Cmd
	// contains filtered or unexported fields
}

func (*Runner) Init

func (g *Runner) Init(ctx context.Context) error

func (*Runner) Kill

func (g *Runner) Kill(ctx context.Context) error

func (*Runner) Run

type VolumeMount

type VolumeMount struct {
	Source string
	Target string
}

Jump to

Keyboard shortcuts

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