Interface for container operation handlers.
| 39 | |
| 40 | // Interface for container operation handlers. |
| 41 | type ContainerHandler interface { |
| 42 | // Returns the ContainerReference |
| 43 | ContainerReference() (info.ContainerReference, error) |
| 44 | |
| 45 | // Returns container's isolation spec. |
| 46 | GetSpec() (info.ContainerSpec, error) |
| 47 | |
| 48 | // Returns the current stats values of the container. |
| 49 | GetStats() (*info.ContainerStats, error) |
| 50 | |
| 51 | // Returns the subcontainers of this container. |
| 52 | ListContainers(listType ListType) ([]info.ContainerReference, error) |
| 53 | |
| 54 | // Returns the processes inside this container. |
| 55 | ListProcesses(listType ListType) ([]int, error) |
| 56 | |
| 57 | // Returns absolute cgroup path for the requested resource. |
| 58 | GetCgroupPath(resource string) (string, error) |
| 59 | |
| 60 | // Returns container labels, if available. |
| 61 | GetContainerLabels() map[string]string |
| 62 | |
| 63 | // Returns the container's ip address, if available |
| 64 | GetContainerIPAddress() string |
| 65 | |
| 66 | // GetExitCode returns the container's exit code if available. |
| 67 | // Returns an error if the container has not exited, exit codes are not supported |
| 68 | // for this handler type, or the container information is unavailable. |
| 69 | GetExitCode() (int, error) |
| 70 | |
| 71 | // Returns whether the container still exists. |
| 72 | Exists() bool |
| 73 | |
| 74 | // Cleanup frees up any resources being held like fds or go routines, etc. |
| 75 | Cleanup() |
| 76 | |
| 77 | // Start starts any necessary background goroutines - must be cleaned up in Cleanup(). |
| 78 | // It is expected that most implementations will be a no-op. |
| 79 | Start() |
| 80 | |
| 81 | // Type of handler |
| 82 | Type() ContainerType |
| 83 | } |
no outgoing calls
no test coverage detected
searching dependent graphs…