MCPcopy
hub / github.com/google/cadvisor / ContainerHandler

Interface ContainerHandler

lib/container/container.go:41–83  ·  view source on GitHub ↗

Interface for container operation handlers.

Source from the content-addressed store, hash-verified

39
40// Interface for container operation handlers.
41type 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}

Callers 27

TestHandlerFunction · 0.65
TestHandlerFunction · 0.65
newContainerDataFunction · 0.65
updateStatsMethod · 0.65
TestHandlerFunction · 0.65
createContainerMethod · 0.65
updateSpecMethod · 0.65
GetStatsMethod · 0.65

Implementers 8

containerHandlercontainer/docker/handler.go
containerHandlercontainer/podman/handler.go
MockContainerHandlercontainer/testing/mock_handler.go
crioContainerHandlerlib/container/crio/handler.go
containerdContainerHandlerlib/container/containerd/handler.go
rawContainerHandlerlib/container/raw/handler.go
MockContainerHandlerlib/container/testing/mock_handler.go
mockHandlerlib/manager/manager_test.go

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…