result

package
v0.0.0-...-9ad74b4 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2019 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 Container

type Container struct {
	// contains filtered or unexported fields
}

Struct that represents a container. It contains a pointer for the docker-defined structure and a list of labels. Generating []Label dynamically after the container started doesn't seem to be a reliable method, since it causes some tests to fail ( see container_result_test.go/TestItShouldReturnRightContainers). The labels are then cached without relying on the Docker struct.

func (*Container) Id

func (c *Container) Id() string

Getter method to return the container id

func (*Container) Labels

func (c *Container) Labels() []Label

Getter method to return a list of labels

func (*Container) RawContainerDefinition

func (c *Container) RawContainerDefinition() *types.Container

Getter method to return the original docker container structure

type ContainerResult

type ContainerResult interface {
	Result
	Containers() []Container
	Filter(
		filter func(container *Container) *Container) (ContainerResult, error)
}

Represents the result for a container search. It allows to get the list of containers found and to filter them

func NewContainerResult

func NewContainerResult(toEncapsulate []types.Container) ContainerResult

Returns a new ContainerResult object from a list of Docker Container types

type Label

type Label struct {
	// contains filtered or unexported fields
}

A label represent a pair of two strings: one identifying the label itself, the other assigning a value to the label

func (*Label) Name

func (l *Label) Name() string

Getter method to return the name of the label

func (*Label) Value

func (l *Label) Value() string

Getter method to return the value of a label

type LabelResult

type LabelResult interface {
	Result
	Labels() []Label
	Filter(filter func(label *Label) *Label) (LabelResult, error)
}

A result is the competition of a listing or filtering operation

func NewLabelResult

func NewLabelResult(toStructure map[string]string) LabelResult

Converts the data returned by the Docker library into a LabelResult struct, that can be used to filter the labels or to perform more complex operations

type Result

type Result interface {
}

Generic interface that groups all the possible results

Jump to

Keyboard shortcuts

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