Documentation ¶
Overview ¶
* Container Lifecycle Service * * This files describes the container lifecycle service * * API version: 1.0.0 * Contact: opensource@peramic.io
* Container Lifecycle Service * * This files describes the container lifecycle service * * API version: 1.0.0 * Contact: opensource@peramic.io
* Container Lifecycle Service * * This files describes the container lifecycle service * * API version: 1.0.0 * Contact: opensource@peramic.io
* Container Lifecycle Service * * This files describes the container lifecycle service * * API version: 1.0.0 * Contact: opensource@peramic.io
Index ¶
- Constants
- Variables
- func CreateNetwork(netns string, id string, container string, ports []cni.PortMapping) error
- func GetClient() (*containerd.Client, error)
- func GetNamespaces() [2]string
- func HandleMessages(topic string, msg logging.Message)
- func TearDownNetwork(netns string, id string, container string, ports []cni.PortMapping) error
- type Client
- func (c *Client) CleanupImages(ns string) error
- func (c *Client) Close()
- func (c *Client) CreateContainer(ns string, img containerd.Image, container *Container) (*Container, error)
- func (c *Client) CreateImageFromSnapshot(ns string, container *Container) ([]byte, error)
- func (c *Client) DeleteContainer(ns string, id string, name string, ignoreService ...bool) error
- func (c *Client) DeleteInactive(ns string, name string) error
- func (c *Client) GetContainer(ns string, id string) (Container, error)
- func (c *Client) GetContainerIdByName(ns string, name string) string
- func (c *Client) GetContainerStatus(result *Container) error
- func (c *Client) GetContainers(ns string) ([]Container, error)
- func (c *Client) GetMounts(ns string, id string) ([]mount.Mount, error)
- func (c *Client) GetPortMapping(ns string, id string) ([]cni.PortMapping, error)
- func (c *Client) MakeContainer(ns string, container *Container) (*Container, error)
- func (c *Client) MakeContainerFromFile(ns string, container *Container) (*Container, error)
- func (c *Client) ResetContainer(ns string, container Container) error
- func (c *Client) StartContainer(ns string, id string) (containerd.Task, <-chan containerd.ExitStatus, error)
- func (c *Client) StopContainer(ns string, container string, task containerd.Task) error
- func (c *Client) SwitchServiceState(name string, state bool) error
- func (c *Client) UpdateContainer(ns string, container *Container) error
- func (c *Client) UpdateExists(ns string, ref string, user string, passwd string) (bool, error)
- func (c *Client) UpgradeContainers(ns string, containers []*Container) error
- type Container
- type Device
- type Manifest
- type Mount
- type Namespace
- type StatusInfo
Constants ¶
const ( Default = "default" System = "system" Runtime = "runtime" ContainerConf = "config" ExposedPorts = "ExposedPorts" ExposedPortsLabel = "org.opencontainers.image.exposedPorts" ContainerDSock = "/run/containerd/containerd.sock" LockFile = "/run/lock/art" MountBaseDir = "/var/lib/apps/" Name = "NAME" Label = "LABEL" Active = "IS_ACTIVE" HostNetwork = "NETHOST" Hostname = "HOSTNAME" )
const ( Create = "Service.CreateService" SwitchState = "Service.SwitchServiceState" GetStatus = "Service.GetStatus" Upgrade = "Service.Upgrade" Delete = "Service.DeleteUnitFile" HealthCheck = "Service.HealthCheck" )
SystemdCalls
const ( Starting = "STARTING" Started = "STARTED" Stopping = "STOPPING" Stopped = "STOPPED" )
const SystemdClient = "systemd:8080"
Variables ¶
var Clients = wbSocketClients{Clients: make(map[*websocket.Conn]bool)}
Clients websocket opened connections
Functions ¶
func CreateNetwork ¶
func GetClient ¶
func GetClient() (*containerd.Client, error)
func GetNamespaces ¶
func GetNamespaces() [2]string
func HandleMessages ¶
Types ¶
type Client ¶
type Client struct { utils.Client CClient *containerd.Client }
func (*Client) CleanupImages ¶
func (*Client) CreateContainer ¶
func (*Client) CreateImageFromSnapshot ¶
func (*Client) DeleteContainer ¶
DeleteContainer ...
func (*Client) GetContainer ¶
func (*Client) GetContainerIdByName ¶
func (*Client) GetContainerStatus ¶
func (*Client) GetPortMapping ¶
func (*Client) MakeContainer ¶
func (*Client) MakeContainerFromFile ¶
func (*Client) ResetContainer ¶
func (*Client) StartContainer ¶
func (c *Client) StartContainer(ns string, id string) (containerd.Task, <-chan containerd.ExitStatus, error)
func (*Client) StopContainer ¶
func (*Client) SwitchServiceState ¶
func (*Client) UpdateContainer ¶
func (*Client) UpdateExists ¶
type Container ¶
type Container struct { Id string `json:"id,omitempty"` Name string `json:"name,omitempty"` Label string `json:"label,omitempty"` Image string `json:"image,omitempty"` User string `json:"user,omitempty"` Passwd string `json:"passwd,omitempty"` Trust bool `json:"trust,omitempty"` State string `json:"state,omitempty"` Namespaces []Namespace `json:"namespaces,omitempty"` Devices []Device `json:"devices,omitempty"` Mounts []Mount `json:"mounts,omitempty"` Capabilities []string `json:"capabilities,omitempty"` //Additional Infos IsActive bool `json:"isactive,omitempty"` IsHostNet bool `json:"ishostnet,omitempty"` Version string `json:"version,omitempty"` }
type Manifest ¶
type Manifest interface { AddLayer(ctx context.Context, contentStore content.Store, layer ocispec.Descriptor) error Descriptor() ocispec.Descriptor }
Manifest The manifest that can be mutated.
func LoadManifest ¶
func LoadManifest(ctx context.Context, contentStore content.Store, desc ocispec.Descriptor) (Manifest, error)
LoadManifest Load a manifest in-memory for easy interaction.