cgroup

package
v1.9.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 5, 2024 License: Apache-2.0 Imports: 4 Imported by: 1

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL