Documentation ¶
Index ¶
- Constants
- type Container
- func (c *Container) GetIP() (net.IP, network.Releaser, error)
- func (c *Container) GetPids() ([]int, error)
- func (c *Container) Kill() error
- func (c *Container) LoadCGroups() error
- func (c *Container) LoadConfig() error
- func (c *Container) MountFromImage(img *image.Image) (filesystem.Unmounter, error)
- func (c *Container) Remove() error
- func (c *Container) SetCPULimit(cpus float64) *Container
- func (c *Container) SetHostname()
- func (c *Container) SetMemorySwapLimit(memory, swap int) *Container
- func (c *Container) SetNetworkNamespace() (network.Unsetter, error)
- func (c *Container) SetPorts(ports string)
- func (c *Container) SetProcessLimit(pids int) *Container
- func (c *Container) SetupNetwork(bridge string) (filesystem.Unmounter, error)
- func (c *Container) SetupPortmap() (nat.Unmapper, error)
- func (c *Container) Stop() error
Constants ¶
const ( DigestStdLen = 64 MB = 1 << 20 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Container ¶
type Container struct { Config *v1.Config Digest string RootFS string Pids []int Ports []string Mounts []string Hostname string Network string IP string // contains filtered or unexported fields }
func GetAllContainers ¶
GetAllContainers returns slice of running Containers.
func GetContainerByDigest ¶
GetContainerByDigest returns a Container associate with a digest.
func NewContainer ¶
func NewContainer() *Container
/ NewContainer returns a new Container with a random digest.
func (*Container) GetPids ¶
GetPids returns slice of pid running inside Container.
NOTE: First element [0], is the fork process.
func (*Container) LoadCGroups ¶
LoadCGroups loads CGroups for container.
func (*Container) LoadConfig ¶
LoadConfig loads and sets Container Config from its image config file.
func (*Container) MountFromImage ¶
MountFromImage mounts filesystem for Container from an Image. It uses overlayFS for union mount of multiple layers.
func (*Container) Remove ¶
Remove removes Container directory. It only works if all mount points have unmounted.
func (*Container) SetCPULimit ¶
SetCPULimit sets Container number of CPUs.
func (*Container) SetHostname ¶
func (c *Container) SetHostname()
SetHostname sets Hostname for container.
If Hostname was empty it uses the digest[:12]
func (*Container) SetMemorySwapLimit ¶
SetMemorySwapLimit sets Container's memory and swap limitation in MegaByte.
func (*Container) SetNetworkNamespace ¶
func (*Container) SetProcessLimit ¶
SetProcessLimit sets maximum simultaneous process for Container.
func (*Container) SetupNetwork ¶
func (c *Container) SetupNetwork(bridge string) (filesystem.Unmounter, error)