detectors

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2015 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package detectors exposes functions to register and use container information extractors.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DetectOS

func DetectOS(data map[string][]byte) string

DetectOS finds the OS of the layer by using every registered OSDetector

func DetectPackages

func DetectPackages(data map[string][]byte) ([]*database.Package, error)

DetectPackages detects packages using every registered PackagesDetector

func GetRequiredFilesOS

func GetRequiredFilesOS() (files []string)

GetRequiredFilesOS returns the list of files required for Detect for every registered OSDetector, without leading /

func GetRequiredFilesPackages

func GetRequiredFilesPackages() (files []string)

GetRequiredFilesPackages returns the list of files required for Detect for every registered PackagesDetector, without leading /

func RegisterOSDetector

func RegisterOSDetector(name string, f OSDetector)

RegisterOSDetector provides a way to dynamically register an implementation of a OSDetector.

If RegisterOSDetector is called twice with the same name if OSDetector is nil, or if the name is blank, it panics.

func RegisterPackagesDetector

func RegisterPackagesDetector(name string, f PackagesDetector)

RegisterPackagesDetector makes a PackagesDetector available for DetectPackages

Types

type OSDetector

type OSDetector interface {
	// Detect detects an Operating System and its version from input data
	Detect(map[string][]byte) (string, string)
	// GetRequiredFiles returns the list of files required for Detect, without
	// leading /
	GetRequiredFiles() []string
}

The OSDetector interface defines a way to detect an Operating System and its version from input data

type PackagesDetector

type PackagesDetector interface {
	// Detect detects packages from the input data
	Detect(map[string][]byte) ([]*database.Package, error)
	// GetRequiredFiles returns the list of files required for Detect, without
	// leading /
	GetRequiredFiles() []string
}

The PackagesDetector interface defines a way to detect packages from input data

Directories

Path Synopsis
Package os defines OSDetector for several sources.
Package os defines OSDetector for several sources.
Package packages defines PackagesDetector for several sources.
Package packages defines PackagesDetector for several sources.

Jump to

Keyboard shortcuts

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