Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ContainerIDFinder ¶
type ContainerIDFinder interface { // FindContainerID returns a container id and true if the known pattern is matched, false otherwise. FindContainerID(cgroup string) (containerID string, found bool) }
ContainerIDFinder finds a container id from a cgroup entry.
func NewContainerIDFinder ¶
func NewContainerIDFinder(patterns []string) (ContainerIDFinder, error)
NewContainerIDFinder returns a new ContainerIDFinder.
The patterns provided should use the Tokens defined in this package in order to describe how a container id should be extracted from a cgroup entry. The given patterns MUST NOT be ambiguous and an error will be returned if multiple patterns can match the same input. An example of invalid input:
"/a/b/<id>" "/*/b/<id>"
Examples:
"/docker/<id>" "/my.slice/*/<id>/*"
Note: The pattern provided is *not* a regular expression. It is a simplified matching language that enforces a forward slash-delimited schema.
Click to show internal directories.
Click to hide internal directories.