convert

package
v1.5.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2018 License: Apache-2.0 Imports: 14 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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