github.com/apptainer/singularity@v3.1.1+incompatible/pkg/ociruntime/ociruntime.go (about)

     1  // Copyright (c) 2018, Sylabs Inc. All rights reserved.
     2  // This software is licensed under a 3-clause BSD license. Please consult the
     3  // LICENSE.md file distributed with the sources of this project regarding your
     4  // rights to use or distribute this software.
     5  
     6  package ociruntime
     7  
     8  import (
     9  	specs "github.com/opencontainers/runtime-spec/specs-go"
    10  )
    11  
    12  const (
    13  	// Creating represent creating status during container lifecycle
    14  	Creating = "creating"
    15  	// Created represent created status during container lifecycle
    16  	Created = "created"
    17  	// Running represent running status during container lifecycle
    18  	Running = "running"
    19  	// Stopped represent stopped status during container lifecycle
    20  	Stopped = "stopped"
    21  	// Paused represent paused status during container lifecycle
    22  	Paused = "paused"
    23  )
    24  
    25  // State represents the state of the container
    26  type State struct {
    27  	specs.State
    28  	CreatedAt     *int64 `json:"createdAt,omitempty"`
    29  	StartedAt     *int64 `json:"startedAt,omitempty"`
    30  	FinishedAt    *int64 `json:"finishedAt,omitempty"`
    31  	ExitCode      *int   `json:"exitCode,omitempty"`
    32  	ExitDesc      string `json:"exitDesc,omitempty"`
    33  	AttachSocket  string `json:"attachSocket,omitempty"`
    34  	ControlSocket string `json:"controlSocket,omitempty"`
    35  }
    36  
    37  // Control is used to pass information for container control
    38  // like terminal resize or log file reopen
    39  type Control struct {
    40  	ConsoleSize    *specs.Box `json:"consoleSize,omitempty"`
    41  	ReopenLog      bool       `json:"reopenLog,omitempty"`
    42  	StartContainer bool       `json:"startContainer,omitempty"`
    43  	Pause          bool       `json:"pause,omitempty"`
    44  	Resume         bool       `json:"resume,omitempty"`
    45  }