convert

package
v1.4.3-dev Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2018 License: Apache-2.0 Imports: 14 Imported by: 14

Documentation

Index

Constants

View Source
const (
	AnnotationKeyLabels     = "docker.labels"
	AnnotationKeyAutoRemove = "docker.autoremove"
)

Variables

This section is empty.

Functions

func ContainerAnnotation

func ContainerAnnotation(annotations map[string]string, key string, value interface{}) error

ContainerAnnotation will convert a vSphere annotation into a docker specific attribute

func SetContainerAnnotation

func SetContainerAnnotation(config *models.ContainerCreateConfig, key string, value interface{}) error

SetContainerAnnotation encodes a docker specific attribute into a vSphere annotation. These vSphere annotations are stored in the VM vmx file

func State

State will create and return a docker ContainerState object from the passed vic ContainerInfo object

Types

type ContainerStats

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

ContainerStats encapsulates the conversion of VMMetrics to docker specific metrics

func NewContainerStats

func NewContainerStats(config *ContainerStatsConfig) *ContainerStats

NewContainerStats will return a new instance of ContainerStats

func (*ContainerStats) IsListening

func (cs *ContainerStats) IsListening() bool

IsListening returns the listening flag

func (*ContainerStats) Listen

func (cs *ContainerStats) Listen() *io.PipeWriter

Listen for new metrics from the portLayer, convert to docker format and encode to the configured Writer.

func (*ContainerStats) Stop

func (cs *ContainerStats) Stop()

Stop will clean up the pipe and flip listening flag

func (*ContainerStats) ToContainerStats

func (cs *ContainerStats) ToContainerStats(current *performance.VMMetrics) (*types.StatsJSON, error)

ToContainerStats will convert the vic VMMetrics to a docker stats struct -- a complete docker stats struct requires two samples. Func will return nil until a complete stat is available

type ContainerStatsConfig

type ContainerStatsConfig struct {
	Ctx            context.Context
	Cancel         context.CancelFunc
	Out            io.Writer
	ContainerID    string
	ContainerState *types.ContainerState
	Memory         int64
	Stream         bool
	VchMhz         int64
}

type InvalidOrderError

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

func (InvalidOrderError) Error

func (iso InvalidOrderError) Error() string

Jump to

Keyboard shortcuts

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