Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DistroLister ¶
type DistroLister interface {
ListDistros() []string
}
type ImageFilter ¶
type ImageFilter struct {
// contains filtered or unexported fields
}
ImageFilter is an a flexible way to filter the available images.
func New ¶
func New(fac *distrofactory.Factory, repos DistroLister) (*ImageFilter, error)
New creates a new ImageFilter that can be used to filter the list of available images
func (*ImageFilter) Filter ¶
func (i *ImageFilter) Filter(searchTerms ...string) ([]Result, error)
Filter filters the available images for the given distrofactory/reporegistry based on the given filter terms. Glob like patterns (?, *) are supported, see fnmatch(3).
Without a prefix in the filter term a simple name filtering is performed. With a prefix the specified property is filtered, e.g. "arch:i386". Adding filtering will narrow down the filtering (terms are combined via AND).
The following prefixes are supported: "distro:" - the distro name, e.g. rhel-9, or fedora* "arch:" - the architecture, e.g. x86_64 "type": - the image type, e.g. ami, or qcow? "bootmode": - the bootmode, e.g. "legacy", "uefi", "hybrid"
type OutputFormat ¶
type OutputFormat string
OutputFormat contains the valid output formats for formatting results
const ( OutputFormatDefault OutputFormat = "" OutputFormatText OutputFormat = "text" OutputFormatJSON OutputFormat = "json" )
type ResultsFormatter ¶
ResultFormatter will format the given result list to the given io.Writer
func NewResultsFormatter ¶
func NewResultsFormatter(format OutputFormat) (ResultsFormatter, error)
NewResultFormatter will create a formatter based on the given format.