# Packages

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Functions

AsNamedMap returns a map of containers where key is the container's name.
CalculateCPUPercent calculates the CPU percentage in range [0-100].
CalculateMemoryPercent calculates the memory percentage.
CalculateParallelLimit calculates the limit for starting parallel jobs.
CalculateUptime calculates the uptime of a container instance.
Copy copies the resources from a given source path to the given destination path.
CopyContainer creates a new container instance from the provided parameter.
DetermineUpdateAction compares the current container with the desired one and determines what action shall be done to achieve desired state.
DeviceMappingToString returns the string representation of the given device mapping.
FileNotExistEmptyOrDir validates whether the provided filename refers to an existing non-empty file.
FillDefaults sets all default configurations which are not required as an input but are required for processing the container's configuration.
FillMemorySwap sets the swap memory of a container.
GetActionMessage returns a text message describing the given action type.
GetDirChildrenNames returns all child directories of the provided one.
GetImageHost retrieves the host name of the container imager registry for the provided image.
GetMemoryLimit takes a limit in bytes.
GetSystemCPUUsage returns the system CPU usage as nanoseconds the CPU has spent performing different work.
IsContainerCreated returns if container is in the created state or not.
IsContainerDead returns whether the container is in Dead state.
IsContainerNetworkBridge returns true if the network mode is bridge.
IsContainerNetworkHost returns true if the network mode is host.
IsContainerRunningOrPaused returns true if the container is running or paused.
IsDirectory returns true if the given path is a directory.
IsFile returns true if the given path is a file.
IsRestartPolicyAlways checks if the restart policy type is set to always.
IsRestartPolicyNone checks if the restart policy type is set to no.
IsRestartPolicyOnFailure checks if the restart policy is set to on-failure.
IsRestartPolicyUnlessStopped checks if the restart policy is set to unless-stopped.
IsRunningSystemd checks whether the host was booted with systemd as its init system.
MkDir creates a directory with the provided name.
MkDirs creates directories for the given directory names.
MountPointToString returns the string representation of the given mount point.
NewLocksCache creates a new LockCache.
ParseDeviceMapping converts a single string representation of a container's device mapping to a structured DeviceMapping instance.
ParseDeviceMappings converts string representations of container's device mappings to structured DeviceMapping instances.
ParseMountPoint converts a single string representation of a container's mount to a structured MountPoint instance.
ParseMountPoints converts string representations of container's mounts to structured MountPoint instances.
ParsePortMapping converts a single string representation of container's port mapping to a structured PortMapping instance.
ParsePortMappings converts string representations of container's port mappings to structured PortMapping instances.
PortMappingToString returns the string representation of the given port mapping.
ReadContainer reads container from file.
RemoveChildren removes all children of a given directory Returns [], nil if everything went OK Returns nil, error if the error happened before or during the retrieval of the children.
SetContainerStatusCreated sets the container state to created updating all required fields and flags.
SetContainerStatusDead sets the container state to dead updating all required fields and flags.
SetContainerStatusExited sets the container state to exited updating all required fields and flags.
SetContainerStatusPaused sets the container state to paused updating all required fields and flags.
SetContainerStatusRunning sets the container state to running updating all required fields and flags.
SetContainerStatusStopped sets the container state to stopped updating all required fields and flags.
SetContainerStatusUnpaused is added for completion as the container's state is actually running.
SizeRecalculate takes size string representation and returns a new recalculated size string representation.
SizeToBytes converts size string representation to a number.
ToSignal parses a string to syscall.Signal.
ValidateConfig validates the container config.
ValidateContainer validats all container properties.
ValidateDeviceMapping validates the mapping between the path on the host and the path in the container and checks if the cgroup permissions are set.
ValidateDeviceMappings validates all device mappings.
ValidateHostConfig validates the container host configuration.
ValidateImage validates the container image.
ValidateLogConfig validates the log configuration.
ValidateMountPoint validates the cointainer mount configuration.
ValidateMounts validates all the cointainer mount points.
ValidateName validates the container name.
ValidateNetworking validates the container networking.
ValidatePrivileged validates that the container privileged configuration does not overlap with other configurations.
ValidateResources validates the container resources limitations.
ValidateRestartPolicy validates the container restart policy.
ValidateStopOpts validates stop options.

# Constants

ActionCheck denotes that current container already has the desired configuration, it shall be checked only if the container is running.
ActionCreate denotes that a new container with desired configurtion shall be created and started.
ActionDestroy denotes that the existing container shall be destroyed.
ActionRecreate denotes that the existing container shall be replaced by a new container with desired configurtion.
ActionUpdate denotes that the existing container shall be runtime updated with desired configurtion.

# Structs

LocksCache provides cache management for identifiable *sync.RWMutex instances.

# Type aliases

ActionType defines a type for an action to achieve desired container.