Documentation ¶
Overview ¶
Package featurefmt exposes functions to dynamically register methods for determining the features present in an image layer.
Package featurefmt contains utility functions for featurefmt tests
Index ¶
- func ListFeatures(files tarutil.FilesMap, toUse []database.Detector) ([]database.LayerFeature, error)
- func ListListers() []database.Detector
- func LoadFileForTest(name string) []byte
- func RegisterLister(name string, version string, l Lister)
- func RequiredFilenames(toUse []database.Detector) (files []string)
- func RunTest(t *testing.T, test TestCase, lister Lister, expectedVersionFormat string)
- type Lister
- type TestCase
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ListFeatures ¶
func ListFeatures(files tarutil.FilesMap, toUse []database.Detector) ([]database.LayerFeature, error)
ListFeatures produces the list of Features in an image layer using every registered Lister.
func ListListers ¶
ListListers returns the names of all the registered feature listers.
func LoadFileForTest ¶
LoadFileForTest can be used in order to obtain the []byte contents of a file that is meant to be used for test data.
func RegisterLister ¶
RegisterLister makes a Lister available by the provided name.
If called twice with the same name, the name is blank, or if the provided Lister is nil, this function panics.
func RequiredFilenames ¶
RequiredFilenames returns all file patterns that will be passed to the given extensions. These patterns are expressed as regexps. Any extension metadata that has non feature-detector type will be skipped.
Types ¶
type Lister ¶
type Lister interface { // ListFeatures produces a list of Features present in an image layer. ListFeatures(tarutil.FilesMap) ([]database.LayerFeature, error) // RequiredFilenames returns a list of patterns for filenames that will // be in the FilesMap provided to the ListFeatures method. // // The patterns are expressed as regexps, and will be matched against // full paths that do not include the leading "/". RequiredFilenames() []string }
Lister represents an ability to list the features present in an image layer.
Directories ¶
Path | Synopsis |
---|---|
Package apk implements a featurefmt.Lister for APK packages.
|
Package apk implements a featurefmt.Lister for APK packages. |
Package dpkg implements a featurefmt.Lister for dpkg packages.
|
Package dpkg implements a featurefmt.Lister for dpkg packages. |
Package rpm implements a featurefmt.Lister for rpm packages.
|
Package rpm implements a featurefmt.Lister for rpm packages. |