containers

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2018 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package containers provides utilities for interacting with Docker containers

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNoContainers is the response to indicate that no containers are active
	ErrNoContainers = errors.New("There are currently no active containers")
)

Functions

func ContainerLogs

func ContainerLogs(cli *docker.Client, opts LogOptions) (io.ReadCloser, error)

ContainerLogs get logs ;)

func GetActiveContainers

func GetActiveContainers(cli *docker.Client) ([]types.Container, error)

GetActiveContainers returns all active containers and returns and error if the Daemon is the only active container

func StopActiveContainers

func StopActiveContainers(cli *docker.Client, out io.Writer) error

StopActiveContainers kills all active project containers (ie not including daemon)

func StreamContainerLogs

func StreamContainerLogs(client *docker.Client, id string, out io.Writer,
	stop chan struct{}) error

StreamContainerLogs streams logs from given container ID. Best used as a goroutine.

Types

type ContainerStopper

type ContainerStopper func(*docker.Client, io.Writer) error

ContainerStopper is a function interface

type LogOptions

type LogOptions struct {
	Container    string
	Stream       bool
	Detailed     bool
	NoTimestamps bool
}

LogOptions is used to configure retrieved container logs

Jump to

Keyboard shortcuts

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