|
5 | 5 | package libcontainer |
6 | 6 |
|
7 | 7 | import ( |
8 | | - "os" |
9 | 8 | "time" |
10 | 9 |
|
11 | 10 | "github.com/opencontainers/runc/libcontainer/configs" |
12 | | - "github.com/opencontainers/runtime-spec/specs-go" |
13 | 11 | ) |
14 | 12 |
|
15 | 13 | // Status is the status of a container. |
@@ -59,68 +57,3 @@ type BaseState struct { |
59 | 57 | // Config is the container's configuration. |
60 | 58 | Config configs.Config `json:"config"` |
61 | 59 | } |
62 | | - |
63 | | -// BaseContainer is a libcontainer container object. |
64 | | -// |
65 | | -// Each container is thread-safe within the same process. Since a container can |
66 | | -// be destroyed by a separate process, any function may return that the container |
67 | | -// was not found. BaseContainer includes methods that are platform agnostic. |
68 | | -type BaseContainer interface { |
69 | | - // Returns the ID of the container |
70 | | - ID() string |
71 | | - |
72 | | - // Returns the current status of the container. |
73 | | - Status() (Status, error) |
74 | | - |
75 | | - // State returns the current container's state information. |
76 | | - State() (*State, error) |
77 | | - |
78 | | - // OCIState returns the current container's state information. |
79 | | - OCIState() (*specs.State, error) |
80 | | - |
81 | | - // Returns the current config of the container. |
82 | | - Config() configs.Config |
83 | | - |
84 | | - // Returns the PIDs inside this container. The PIDs are in the namespace of the calling process. |
85 | | - // |
86 | | - // Some of the returned PIDs may no longer refer to processes in the Container, unless |
87 | | - // the Container state is PAUSED in which case every PID in the slice is valid. |
88 | | - Processes() ([]int, error) |
89 | | - |
90 | | - // Returns statistics for the container. |
91 | | - Stats() (*Stats, error) |
92 | | - |
93 | | - // Set resources of container as configured |
94 | | - // |
95 | | - // We can use this to change resources when containers are running. |
96 | | - // |
97 | | - Set(config configs.Config) error |
98 | | - |
99 | | - // Start a process inside the container. Returns error if process fails to |
100 | | - // start. You can track process lifecycle with passed Process structure. |
101 | | - Start(process *Process) (err error) |
102 | | - |
103 | | - // Run immediately starts the process inside the container. Returns error if process |
104 | | - // fails to start. It does not block waiting for the exec fifo after start returns but |
105 | | - // opens the fifo after start returns. |
106 | | - Run(process *Process) (err error) |
107 | | - |
108 | | - // Destroys the container, if its in a valid state, after killing any |
109 | | - // remaining running processes. |
110 | | - // |
111 | | - // Any event registrations are removed before the container is destroyed. |
112 | | - // No error is returned if the container is already destroyed. |
113 | | - // |
114 | | - // Running containers must first be stopped using Signal(..). |
115 | | - // Paused containers must first be resumed using Resume(..). |
116 | | - Destroy() error |
117 | | - |
118 | | - // Signal sends the provided signal code to the container's initial process. |
119 | | - // |
120 | | - // If all is specified the signal is sent to all processes in the container |
121 | | - // including the initial process. |
122 | | - Signal(s os.Signal, all bool) error |
123 | | - |
124 | | - // Exec signals the container to exec the users process at the end of the init. |
125 | | - Exec() error |
126 | | -} |
0 commit comments