Documentation
¶
Overview ¶
Package scope provides an abstraction to allow a user to loosely define a data source to catalog and expose a common interface that catalogers and use explore and analyze data from the data source. All valid (cataloggable) data sources are defined within this package.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Options = []Option{ SquashedScope, AllLayersScope, }
Functions ¶
This section is empty.
Types ¶
type ContentResolver ¶
type ContentResolver interface {
MultipleFileContentsByRef(f ...file.Reference) (map[file.Reference]string, error)
}
ContentResolver knows how to get file content for given file.References
type DirSource ¶
type DirSource struct {
Path string // the root path to be cataloged
}
DirSource represents a data source that is a filesystem directory tree
type FileResolver ¶
type FileResolver interface {
FilesByPath(paths ...file.Path) ([]file.Reference, error)
FilesByGlob(patterns ...string) ([]file.Reference, error)
}
FileResolver knows how to get file.References for given string paths and globs
type ImageSource ¶
ImageSource represents a data source that is a container image
type Resolver ¶
type Resolver interface {
ContentResolver
FileResolver
}
Resolver is an interface that encompasses how to get specific file references and file contents for a generic data source.
type Scope ¶
type Scope struct {
Option Option // specific perspective to catalog
Resolver Resolver // a Resolver object to use in file path/glob resolution and file contents resolution
ImgSrc ImageSource // the specific image to be cataloged
DirSrc DirSource // the specific directory to be cataloged
}
Scope is an object that captures the data source to be cataloged, configuration, and a specific resolver used in cataloging (based on the data source and configuration)
func NewScopeFromDir ¶
NewScopeFromDir creates a new scope object tailored to catalog a given filesystem directory recursively.
func NewScopeFromImage ¶
NewScopeFromImage creates a new scope object tailored to catalog a given container image, relative to the option given (e.g. all-layers, squashed, etc)
Directories
¶
| Path | Synopsis |
|---|---|
|
Package resolvers provides concrete implementations for the scope.Resolver interface for all supported data sources and scope options.
|
Package resolvers provides concrete implementations for the scope.Resolver interface for all supported data sources and scope options. |