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 {
FileContentsByRef(ref file.Reference) (string, error)
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 fetches a set of file references which have the given path (for an image, there may be multiple matches)
FilesByPath(paths ...file.Path) ([]file.Reference, error)
// FilesByGlob fetches a set of file references which the given glob matches
FilesByGlob(patterns ...string) ([]file.Reference, error)
// RelativeFileByPath fetches a single file at the given path relative to the layer squash of the given reference.
// This is helpful when attempting to find a file that is in the same layer or lower as another file.
RelativeFileByPath(reference file.Reference, path 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
Source interface{} // the specific source object to be cataloged
Scheme Scheme // the source data scheme type (directory or image)
}
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.
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. |