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 ¶
Constants ¶
This section is empty.
Variables ¶
var AllScopes = []Scope{ SquashedScope, AllLayersScope, }
AllScopes is a slice containing all possible scope options
Functions ¶
This section is empty.
Types ¶
type Alias ¶
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 DirectoryMetadata ¶
type ExcludeConfig ¶
type ExcludeConfig struct {
Paths []string
}
type FileMetadata ¶
type ImageMetadata ¶
type ImageMetadata 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 []LayerMetadata `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"`
}
ImageMetadata 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.
type LayerMetadata ¶
type LayerMetadata struct {
MediaType string `json:"mediaType"`
Digest string `json:"digest"`
Size int64 `json:"size"`
}
LayerMetadata represents all static metadata that defines what a container image layer is.
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