docker

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package docker extracts container inventory from docker API.

Index

Constants

View Source
const (
	// Name is the unique name of this extractor.
	Name = "containers/docker"
)

Variables

This section is empty.

Functions

func New

func New() standalone.Extractor

New returns an extractor

func NewWithClient

func NewWithClient(c Client) standalone.Extractor

NewWithClient returns an extractor which uses a specified docker client.

Types

type Client

type Client interface {
	ContainerList(ctx context.Context, options container.ListOptions) ([]container.Summary, error)
}

Client is an interface that provides an abstraction on top of the docker client.

type Extractor

type Extractor struct {
	// contains filtered or unexported fields
}

Extractor implements the docker extractor.

func (*Extractor) Extract

Extract extracts containers from the docker API.

func (Extractor) Name

func (e Extractor) Name() string

Name of the extractor.

func (Extractor) Requirements

func (e Extractor) Requirements() *plugin.Capabilities

Requirements of the extractor.

func (Extractor) Version

func (e Extractor) Version() int

Version of the extractor.

type Metadata

type Metadata struct {
	ImageName   string
	ImageDigest string
	ID          string
	Ports       []container.Port
}

Metadata holds parsing information for a container running in docker.

Directories

Path Synopsis
Package fakeclient contains a fake implementation of the docker client for testing purposes.
Package fakeclient contains a fake implementation of the docker client for testing purposes.

Jump to

Keyboard shortcuts

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