docker

package
v0.0.0-...-b425644 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2019 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

docker related datastructures.

This packages contains datastructures used in the communication with docker, i.e. those that are sent and received while communicating with the docker API.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Container

type Container struct {
	Id         string
	Image      string
	Command    string
	Created    int64 `json:"Created"`
	Status     string
	Ports      []*PortConfig
	SizeRw     int
	SizeRootFs int
	Names      []string
}

func (*Container) CreatedAt

func (self *Container) CreatedAt() time.Time

func (*Container) String

func (container *Container) String() string

type ContainerConfig

type ContainerConfig struct {
	Hostname        string
	Domainname      string
	User            string
	Memory          int64 // Memory limit (in bytes)
	MemorySwap      int64 // Total memory usage (memory + swap); set `-1' to disable swap
	CpuShares       int64 // CPU shares (relative weight vs. other containers)
	AttachStdin     bool
	AttachStdout    bool
	AttachStderr    bool
	PortSpecs       []string
	ExposedPorts    map[Port]struct{}
	Tty             bool // Attach standard streams to a tty, including stdin if it is not closed.
	OpenStdin       bool // Open stdin
	StdinOnce       bool // If true, close stdin after the 1 attached client disconnects.
	Env             []string
	Cmd             []string
	Dns             []string
	Image           string // Name of the image as it was passed by the operator (eg. could be symbolic)
	Volumes         map[string]struct{}
	VolumesFrom     string
	WorkingDir      string
	Entrypoint      []string
	NetworkDisabled bool
}

https://github.com/dotcloud/docker/blob/master/container.go#L60-81

type ContainerInfo

type ContainerInfo struct {
	Id              string `json:"ID"`
	Image           string
	CreatedAt       time.Time `json:"Created"`
	SysInitPath     string
	ResolvConfPath  string
	Volumes         map[string]string
	VolumesRW       map[string]bool
	Path            string
	Args            []string
	ContainerConfig ContainerConfig `json:"Config"`
	NetworkConfig   NetworkSettings `json:"NetworkSettings"`
	HostConfig      HostConfig      `json:"HostConfig"`
}

type HostConfig

type HostConfig struct {
	PublishAllPorts bool
	NetworkMode     string
	Binds           []string
	PortBindings    map[Port][]PortBinding
	LxcConf         map[string]string
}

type Image

type Image struct {
	Repository  string   `json:"Repository"`
	Tags        []string `json:"RepoTags"`
	Id          string   `json:"Id"`
	Created     int
	Size        int
	VirtualSize int
}

Basic image information as returned by docker.

func (*Image) CreatedAt

func (self *Image) CreatedAt() time.Time

func (*Image) String

func (img *Image) String() string

type ImageDetails

type ImageDetails struct {
	Id              string           `json:"id"`
	Parent          string           `json:"parent"`
	Created         string           `json:"created"`
	Container       string           `json:"container"`
	Size            int              `json:"size"`
	Architecture    string           `json:"architecture"`
	DockerVersion   string           `json:"docker_version"`
	ContainerConfig *ContainerConfig `json:"container_config"`
	Config          *ContainerConfig `json:"config"`
}

Image details as returned by docker.

func (*ImageDetails) CreatedAt

func (image *ImageDetails) CreatedAt() (time.Time, error)

type ImageHistory

type ImageHistory []struct {
	Id   string
	Tags []string

	CreatedBy string
	// contains filtered or unexported fields
}

Image history entries as returned by docker.

type NetworkSettings

type NetworkSettings struct {
	Ip          string `json:"IPAddress"`
	IPPrefixLen int
	Gateway     string
	Bridge      string
	PortMapping map[string]map[string]string
	Ports       map[Port][]PortBinding
}

func (*NetworkSettings) PortMappingFor

func (settings *NetworkSettings) PortMappingFor(protocol string) map[string]string

func (*NetworkSettings) PortMappingString

func (settings *NetworkSettings) PortMappingString() string

func (*NetworkSettings) TcpPortMapping

func (settings *NetworkSettings) TcpPortMapping() map[string]string

func (*NetworkSettings) UdpPortMapping

func (settings *NetworkSettings) UdpPortMapping() map[string]string

type Port

type Port string

type PortBinding

type PortBinding struct {
	HostIp   string
	HostPort string
}

type PortConfig

type PortConfig struct {
	Private  int    `json:"PrivatePort"`
	Public   int    `json:"PublicPort"`
	Protocol string `json:"Type"`
	Ip       string `json:"IP"`
}

Jump to

Keyboard shortcuts

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