types

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2020 License: Apache-2.0 Imports: 0 Imported by: 1

Documentation

Overview

Package types contains types used for managing the containers. They are put in separate package to avoid cyclic dependencies while importing.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ContainerConfig

type ContainerConfig struct {
	Name        string    `json:"name"`
	Image       string    `json:"image"`
	Args        []string  `json:"args,omitempty"`
	Entrypoint  []string  `json:"entrypoint,omitempty"`
	Ports       []PortMap `json:"ports,omitempty"`
	Mounts      []Mount   `json:"mounts,omitempty"`
	Privileged  bool      `json:"privileged,omitempty"`
	NetworkMode string    `json:"networkMode,omitempty"`
	PidMode     string    `json:"pidMode,omitempty"`
	IpcMode     string    `json:"ipcMode,omitempty"`
	User        string    `json:"user,omitempty"`
	Group       string    `json:"group,omitempty"`
}

ContainerConfig stores runtime-agnostic information how to run the container

type ContainerStatus

type ContainerStatus struct {
	ID     string `json:"id,omitempty"`
	Status string `json:"status,omitempty"`
}

ContainerStatus stores status information received from the runtime TODO this should cover all fields which are defined in ContainerConfig, so we can read and compare if actual configuration matches our expectations.

func (*ContainerStatus) Exists added in v0.2.0

func (s *ContainerStatus) Exists() bool

Exists controls, how container existence is determined based on ContainerStatus. If state has no ID set, it means that container does not exist.

func (*ContainerStatus) Running added in v0.2.0

func (s *ContainerStatus) Running() bool

Running determines if container is running, based on ContainerStatus.

type File

type File struct {
	Path    string `json:"path"`
	Content string `json:"content"`
	Mode    int64  `json:"mode"`
	User    string `json:"uid"`
	Group   string `json:"gid"`
}

File describes file, which can be either copied to or from container.

type Mount

type Mount struct {
	Source      string `json:"source"`
	Target      string `json:"target"`
	Propagation string `json:"propagation,omitempty"`
}

Mount describe host bind mount TODO Same as PortMap

type PortMap

type PortMap struct {
	IP       string `json:"ip"`
	Port     int    `json:"port"`
	Protocol string `json:"protocol"`
}

PortMap is basically a github.com/docker/go-connections/nat.PortMap TODO Once we introduce Kubelet runtime, we need to figure out how to structure it

Jump to

Keyboard shortcuts

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