docker

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2024 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Orchestrator

type Orchestrator struct {
	*client.Client
	// contains filtered or unexported fields
}

func New

func New(prune bool, pruneInterval time.Duration) (Orchestrator, error)

func (*Orchestrator) AttachContainer added in v0.6.0

Attach to a running docker container. Connection should be closed when finished.

func (*Orchestrator) GetLogs

func (orch *Orchestrator) GetLogs(gl scheduler.GetLogsRequest) (io.Reader, error)

GetLogs streams the logs from a docker container to an io.Reader.

To do this we first have to de-muliplex the docker logs as they start in a custom format where both stdout and stderr are part of the same stream. The de-multiplexing is done by the StdCopy function that docker provides.

Since we need to de-multiplex the stream, but still stream it to the caller, we pass the StdCopy function an io.Pipe which simply works a single spaced buffer. For every write the caller must read before another write can move forward.

func (*Orchestrator) GetState

func (*Orchestrator) StartContainer

func (*Orchestrator) StopContainer

func (orch *Orchestrator) StopContainer(req scheduler.StopContainerRequest) error

Jump to

Keyboard shortcuts

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