Documentation ¶
Overview ¶
Package source 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 ¶
- Variables
- func NewCoordinateSet(coordinates ...file.Coordinates) file.CoordinateSetdeprecated
- func NewLocation(realPath string) file.Locationdeprecated
- func NewLocationFromCoordinates(coordinates file.Coordinates) file.Locationdeprecated
- func NewLocationFromDirectory(responsePath string, ref stereoscopeFile.Reference) file.Locationdeprecated
- func NewLocationFromImage(virtualPath string, ref stereoscopeFile.Reference, img *image.Image) file.Locationdeprecated
- func NewLocationReadCloser(location file.Location, reader io.ReadCloser) file.LocationReadCloserdeprecated
- func NewLocationSet(locations ...file.Location) file.LocationSetdeprecated
- func NewMockResolverForPaths(paths ...string) *file.MockResolverdeprecated
- func NewMockResolverForPathsWithMetadata(metadata map[file.Coordinates]file.Metadata) *file.MockResolverdeprecated
- func NewVirtualLocation(realPath, virtualPath string) file.Locationdeprecated
- func NewVirtualLocationFromCoordinates(coordinates file.Coordinates, virtualPath string) file.Locationdeprecated
- func NewVirtualLocationFromDirectory(responsePath, virtualResponsePath string, ref stereoscopeFile.Reference) file.Locationdeprecated
- type Alias
- type CoordinateSetdeprecated
- type Coordinatesdeprecated
- type Description
- type DetectConfig
- type Detection
- type DetectionSourceConfig
- type DirectoryConfig
- type DirectorySource
- type DirectorySourceMetadata
- type ExcludeConfig
- type FileConfig
- type FileContentResolverdeprecated
- type FileLocationResolverdeprecated
- type FileMetadatadeprecated
- type FileMetadataResolverdeprecated
- type FilePathResolverdeprecated
- type FileResolverdeprecated
- type FileSource
- type FileSourceMetadata
- type Locationdeprecated
- type LocationDatadeprecated
- type LocationMetadatadeprecated
- type LocationReadCloserdeprecated
- type LocationSetdeprecated
- type Locationsdeprecated
- type MockResolverdeprecated
- type Scope
- type Source
- type StereoscopeImageConfig
- type StereoscopeImageSource
- type StereoscopeImageSourceMetadata
- type StereoscopeLayerMetadata
- type WritableFileResolverdeprecated
Constants ¶
This section is empty.
Variables ¶
var AllScopes = []Scope{ SquashedScope, AllLayersScope, }
AllScopes is a slice containing all possible scope options
Functions ¶
func NewCoordinateSet
deprecated
func NewCoordinateSet(coordinates ...file.Coordinates) file.CoordinateSet
Deprecated: use file.NewCoordinateSet instead
func NewLocation
deprecated
func NewLocationFromCoordinates
deprecated
func NewLocationFromCoordinates(coordinates file.Coordinates) file.Location
Deprecated: use file.NewLocationFromCoordinates instead
func NewLocationFromDirectory
deprecated
func NewLocationFromDirectory(responsePath string, ref stereoscopeFile.Reference) file.Location
Deprecated: use file.NewLocationFromDirectory instead
func NewLocationFromImage
deprecated
func NewLocationReadCloser
deprecated
func NewLocationReadCloser(location file.Location, reader io.ReadCloser) file.LocationReadCloser
Deprecated: use file.NewLocationReadCloser instead
func NewLocationSet
deprecated
func NewLocationSet(locations ...file.Location) file.LocationSet
Deprecated: use file.NewLocationSet instead
func NewMockResolverForPaths
deprecated
func NewMockResolverForPaths(paths ...string) *file.MockResolver
Deprecated: use file.NewMockResolverForPaths instead
func NewMockResolverForPathsWithMetadata
deprecated
func NewMockResolverForPathsWithMetadata(metadata map[file.Coordinates]file.Metadata) *file.MockResolver
Deprecated: use file.NewMockResolverForPathsWithMetadata instead
func NewVirtualLocation
deprecated
func NewVirtualLocationFromCoordinates
deprecated
func NewVirtualLocationFromCoordinates(coordinates file.Coordinates, virtualPath string) file.Location
Deprecated: use file.NewVirtualLocationFromCoordinates instead
func NewVirtualLocationFromDirectory
deprecated
func NewVirtualLocationFromDirectory(responsePath, virtualResponsePath string, ref stereoscopeFile.Reference) file.Location
Deprecated: use file.NewVirtualLocationFromDirectory instead
Types ¶
type Alias ¶
type CoordinateSet
deprecated
type CoordinateSet = file.CoordinateSet
Deprecated: use file.CoordinateSet instead
type Coordinates
deprecated
type Coordinates = file.Coordinates
Deprecated: use file.Coordinates instead
type Description ¶
type Description struct { ID string `hash:"ignore"` // the id generated from the parent source struct Name string `hash:"ignore"` Version string `hash:"ignore"` Metadata interface{} }
Description represents any static source data that helps describe "what" was cataloged.
type DetectConfig ¶
type DetectConfig struct {
DefaultImageSource string
}
func DefaultDetectConfig ¶
func DefaultDetectConfig() DetectConfig
type Detection ¶
type Detection struct {
// contains filtered or unexported fields
}
Detection is an object that captures the detected user input regarding source location, scheme, and provider type. It acts as a struct input for some source constructors.
func Detect ¶
func Detect(userInput string, cfg DetectConfig) (*Detection, error)
Detect generates a source Detection that can be used as an argument to generate a new source from specific providers including a registry, with an explicit name.
func (Detection) IsContainerImage ¶
type DetectionSourceConfig ¶
type DetectionSourceConfig struct { Alias Alias RegistryOptions *image.RegistryOptions Platform *image.Platform Exclude ExcludeConfig DigestAlgorithms []crypto.Hash BasePath string }
func DefaultDetectionSourceConfig ¶
func DefaultDetectionSourceConfig() DetectionSourceConfig
type DirectoryConfig ¶
type DirectoryConfig struct { Path string Base string Exclude ExcludeConfig Alias Alias }
type DirectorySource ¶
type DirectorySource struct {
// contains filtered or unexported fields
}
func NewFromDirectory ¶
func NewFromDirectory(cfg DirectoryConfig) (*DirectorySource, error)
func NewFromDirectoryPath ¶
func NewFromDirectoryPath(path string) (*DirectorySource, error)
func (*DirectorySource) Close ¶
func (s *DirectorySource) Close() error
func (DirectorySource) Describe ¶
func (s DirectorySource) Describe() Description
func (*DirectorySource) FileResolver ¶
func (s *DirectorySource) FileResolver(_ Scope) (file.Resolver, error)
func (DirectorySource) ID ¶
func (s DirectorySource) ID() artifact.ID
type DirectorySourceMetadata ¶
type ExcludeConfig ¶
type ExcludeConfig struct {
Paths []string
}
type FileConfig ¶
type FileConfig struct { Path string Exclude ExcludeConfig DigestAlgorithms []crypto.Hash Alias Alias }
type FileContentResolver
deprecated
type FileContentResolver = file.ContentResolver
Deprecated: use file.ContentResolver instead
type FileLocationResolver
deprecated
type FileLocationResolver = file.LocationResolver
Deprecated: use file.LocationResolver instead
type FileMetadata
deprecated
type FileMetadataResolver
deprecated
type FileMetadataResolver = file.MetadataResolver
Deprecated: use file.MetadataResolver instead
type FilePathResolver
deprecated
type FilePathResolver = file.PathResolver
Deprecated: use file.PathResolver instead
type FileResolver
deprecated
type FileSource ¶
type FileSource struct {
// contains filtered or unexported fields
}
func NewFromFile ¶
func NewFromFile(cfg FileConfig) (*FileSource, error)
func (*FileSource) Close ¶
func (s *FileSource) Close() error
func (FileSource) Describe ¶
func (s FileSource) Describe() Description
func (FileSource) FileResolver ¶
func (s FileSource) FileResolver(_ Scope) (file.Resolver, error)
func (FileSource) ID ¶
func (s FileSource) ID() artifact.ID
type FileSourceMetadata ¶
type LocationData
deprecated
type LocationData = file.LocationData
Deprecated: use file.LocationData instead
type LocationMetadata
deprecated
type LocationMetadata = file.LocationMetadata
Deprecated: use file.LocationMetadata instead
type LocationReadCloser
deprecated
type LocationReadCloser = file.LocationReadCloser
Deprecated: use file.LocationReadCloser instead
type LocationSet
deprecated
type LocationSet = file.LocationSet
Deprecated: use file.LocationSet instead
type MockResolver
deprecated
type MockResolver = file.MockResolver
Deprecated: use file.MockResolver instead
type Scope ¶
type Scope string
Scope indicates "how" or from "which perspectives" the source object should be cataloged from.
const ( // UnknownScope is the default scope UnknownScope Scope = "unknown-scope" // SquashedScope indicates to only catalog content visible from the squashed filesystem representation (what can be seen only within the container at runtime) SquashedScope Scope = "squashed" // AllLayersScope indicates to catalog content on all layers, regardless if it is visible from the container at runtime. AllLayersScope Scope = "all-layers" )
func ParseScope ¶
ParseScope returns a scope as indicated from the given string.
type Source ¶
type Source interface { artifact.Identifiable FileResolver(Scope) (file.Resolver, error) Describe() Description io.Closer }
func FromDescription ¶
func FromDescription(d Description) Source
type StereoscopeImageConfig ¶
type StereoscopeImageConfig struct { Reference string From image.Source Platform *image.Platform RegistryOptions *image.RegistryOptions Exclude ExcludeConfig Alias Alias }
type StereoscopeImageSource ¶
type StereoscopeImageSource struct {
// contains filtered or unexported fields
}
func NewFromStereoscopeImage ¶
func NewFromStereoscopeImage(cfg StereoscopeImageConfig) (*StereoscopeImageSource, error)
func (StereoscopeImageSource) Close ¶
func (s StereoscopeImageSource) Close() error
func (StereoscopeImageSource) Describe ¶
func (s StereoscopeImageSource) Describe() Description
func (StereoscopeImageSource) FileResolver ¶
func (s StereoscopeImageSource) FileResolver(scope Scope) (file.Resolver, error)
func (StereoscopeImageSource) ID ¶
func (s StereoscopeImageSource) ID() artifact.ID
type StereoscopeImageSourceMetadata ¶
type StereoscopeImageSourceMetadata struct { UserInput string `json:"userInput"` ID string `json:"imageID"` ManifestDigest string `json:"manifestDigest"` MediaType string `json:"mediaType"` Tags []string `json:"tags"` Size int64 `json:"imageSize"` Layers []StereoscopeLayerMetadata `json:"layers"` RawManifest []byte `json:"manifest"` RawConfig []byte `json:"config"` RepoDigests []string `json:"repoDigests"` Architecture string `json:"architecture"` Variant string `json:"architectureVariant,omitempty"` OS string `json:"os"` Labels map[string]string `json:"labels,omitempty"` }
StereoscopeImageSourceMetadata represents all static metadata that defines what a container image is. This is useful to later describe "what" was cataloged without needing the more complicated stereoscope Image objects or FileResolver objects.
func NewStereoscopeImageMetadata ¶
func NewStereoscopeImageMetadata(img *image.Image, userInput string) StereoscopeImageSourceMetadata
NewStereoscopeImageMetadata creates a new ImageMetadata object populated from the given stereoscope Image object and user configuration.
type StereoscopeLayerMetadata ¶
type StereoscopeLayerMetadata struct { MediaType string `json:"mediaType"` Digest string `json:"digest"` Size int64 `json:"size"` }
StereoscopeLayerMetadata represents all static metadata that defines what a container image layer is.
type WritableFileResolver
deprecated
type WritableFileResolver = file.WritableResolver
Deprecated: use file.WritableResolver instead