resolvers

package
v0.7.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 12, 2020 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package resolvers provides concrete implementations for the scope.Resolver interface for all supported data sources and scope options.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AllLayersResolver

type AllLayersResolver struct {
	// contains filtered or unexported fields
}

AllLayersResolver implements path and content access for the AllLayers scope option for container image data sources.

func NewAllLayersResolver

func NewAllLayersResolver(img *image.Image) (*AllLayersResolver, error)

NewAllLayersResolver returns a new resolver from the perspective of all image layers for the given image.

func (*AllLayersResolver) FileContentsByRef added in v0.4.0

func (r *AllLayersResolver) FileContentsByRef(ref file.Reference) (string, error)

FileContentsByRef fetches file contents for a single file reference, irregardless of the source layer. If the path does not exist an error is returned.

func (*AllLayersResolver) FilesByGlob

func (r *AllLayersResolver) FilesByGlob(patterns ...string) ([]file.Reference, error)

FilesByGlob returns all file.References that match the given path glob pattern from any layer in the image.

func (*AllLayersResolver) FilesByPath

func (r *AllLayersResolver) FilesByPath(paths ...file.Path) ([]file.Reference, error)

FilesByPath returns all file.References that match the given paths from any layer in the image.

func (*AllLayersResolver) MultipleFileContentsByRef

func (r *AllLayersResolver) MultipleFileContentsByRef(f ...file.Reference) (map[file.Reference]string, error)

MultipleFileContentsByRef returns the file contents for all file.References relative to the image. Note that a file.Reference is a path relative to a particular layer.

func (*AllLayersResolver) RelativeFileByPath added in v0.4.0

func (r *AllLayersResolver) RelativeFileByPath(reference file.Reference, path string) (*file.Reference, error)

type DirectoryResolver

type DirectoryResolver struct {
	Path string
}

DirectoryResolver implements path and content access for the directory data source.

func (DirectoryResolver) FileContentsByRef added in v0.4.0

func (s DirectoryResolver) FileContentsByRef(reference file.Reference) (string, error)

FileContentsByRef fetches file contents for a single file reference relative to a directory. If the path does not exist an error is returned.

func (DirectoryResolver) FilesByGlob

func (s DirectoryResolver) FilesByGlob(patterns ...string) ([]file.Reference, error)

FilesByGlob returns all file.References that match the given path glob pattern from any layer in the image.

func (DirectoryResolver) FilesByPath

func (s DirectoryResolver) FilesByPath(userPaths ...file.Path) ([]file.Reference, error)

FilesByPath returns all file.References that match the given paths from the directory.

func (DirectoryResolver) MultipleFileContentsByRef

func (s DirectoryResolver) MultipleFileContentsByRef(f ...file.Reference) (map[file.Reference]string, error)

MultipleFileContentsByRef returns the file contents for all file.References relative a directory.

func (*DirectoryResolver) RelativeFileByPath added in v0.4.0

func (s *DirectoryResolver) RelativeFileByPath(_ file.Reference, path string) (*file.Reference, error)

func (DirectoryResolver) String

func (s DirectoryResolver) String() string

Stringer to represent a directory path data source

type ImageSquashResolver

type ImageSquashResolver struct {
	// contains filtered or unexported fields
}

ImageSquashResolver implements path and content access for the Squashed scope option for container image data sources.

func NewImageSquashResolver

func NewImageSquashResolver(img *image.Image) (*ImageSquashResolver, error)

NewImageSquashResolver returns a new resolver from the perspective of the squashed representation for the given image.

func (*ImageSquashResolver) FileContentsByRef added in v0.4.0

func (r *ImageSquashResolver) FileContentsByRef(ref file.Reference) (string, error)

FileContentsByRef fetches file contents for a single file reference, irregardless of the source layer. If the path does not exist an error is returned.

func (*ImageSquashResolver) FilesByGlob

func (r *ImageSquashResolver) FilesByGlob(patterns ...string) ([]file.Reference, error)

FilesByGlob returns all file.References that match the given path glob pattern within the squashed representation of the image.

func (*ImageSquashResolver) FilesByPath

func (r *ImageSquashResolver) FilesByPath(paths ...file.Path) ([]file.Reference, error)

FilesByPath returns all file.References that match the given paths within the squashed representation of the image.

func (*ImageSquashResolver) MultipleFileContentsByRef

func (r *ImageSquashResolver) MultipleFileContentsByRef(f ...file.Reference) (map[file.Reference]string, error)

MultipleFileContentsByRef returns the file contents for all file.References relative to the image. Note that a file.Reference is a path relative to a particular layer, in this case only from the squashed representation.

func (*ImageSquashResolver) RelativeFileByPath added in v0.4.0

func (r *ImageSquashResolver) RelativeFileByPath(reference file.Reference, path string) (*file.Reference, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL