Documentation ¶
Overview ¶
Package container tracks the current containers from the docker runtime.
Index ¶
Constants ¶
View Source
const ( StateNameDockerContainer = "docker_container" StateKeyDockerContainerData = "data" StateKeyDockerContainerEncoding = "encoding" StateValueDockerContainerEncodingJSON = "json" PodNameLabel = "io.kubernetes.pod.name" PodNamespaceLabel = "io.kubernetes.pod.namespace" )
View Source
const Name = "docker-container"
Variables ¶
This section is empty.
Functions ¶
func IsDockerRunning ¶
func IsDockerRunning() bool
If not run, fails with: "Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?"
func ListContainers ¶
func ListContainers(ctx context.Context) ([]docker_types.Container, error)
If not run, fails with: "Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?"
Types ¶
type Config ¶
type Config struct { Query query_config.Config `json:"query"` Endpoint string `json:"endpoint"` }
type DockerContainer ¶
type DockerContainer struct { ID string `json:"id,omitempty"` Name string `json:"name,omitempty"` Image string `json:"image,omitempty"` CreatedAt int64 `json:"created_at,omitempty"` State string `json:"state,omitempty"` PodName string `json:"pod_name,omitempty"` PodNamespace string `json:"pod_namespace,omitempty"` }
func ConvertToDockerContainer ¶
func ConvertToDockerContainer(resp docker_types.Container) DockerContainer
func ParseStateDockerContainer ¶
func ParseStateDockerContainer(m map[string]string) ([]DockerContainer, error)
func (DockerContainer) JSON ¶
func (s DockerContainer) JSON() ([]byte, error)
type Output ¶
type Output struct {
Containers []DockerContainer `json:"containers,omitempty"`
}
func ParseOutputJSON ¶
func ParseStatesToOutput ¶
func ParseStatesToOutput(states ...components.State) (*Output, error)
Click to show internal directories.
Click to hide internal directories.