fakelayerbuilder

package
v0.4.4 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2026 License: Apache-2.0, BSD-3-Clause, MIT Imports: 18 Imported by: 0

Documentation

Overview

Package fakelayerbuilder uses a yaml file with custom syntax to build up fake layers for testing

Example:

```yml

layers:

# Add foo.txt lockfile
- files:
    foo.txt:
    	# With the package foo
        - foo
    bar.txt:
        - bar
# Delete the bar lockfile
- files:
    !bar.txt:
- files:
    baz.txt:
        - baz
    # Readd bar
- files:
    bar.txt:
        - bar

```

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildFakeChainLayersFromPath

func BuildFakeChainLayersFromPath(t *testing.T, testDir string, layerInfoPath string) []*fakechainlayer.FakeChainLayer

BuildFakeChainLayersFromPath builds a slice of fake chain layers from a yaml file as defined at the top of this file.

Types

type FakeTestLayers

type FakeTestLayers struct {
	Layers []struct {
		Files map[string][]string `yaml:"files"`
	} `yaml:"layers"`
}

FakeTestLayers structure is used to mock a fake image filesystem to test extraction against.

type FakeTestLayersExtractor

type FakeTestLayersExtractor struct {
}

FakeTestLayersExtractor extracts FakeTestLayers built from the FakeLayerBuilder

func (FakeTestLayersExtractor) Extract

Extract extracts packages from yarn.lock files passed through the scan input.

func (FakeTestLayersExtractor) FileRequired

func (e FakeTestLayersExtractor) FileRequired(_ filesystem.FileAPI) bool

FileRequired always returns true, as this is for testing only

func (FakeTestLayersExtractor) Name

Name of the extractor.

func (FakeTestLayersExtractor) Requirements

func (e FakeTestLayersExtractor) Requirements() *plugin.Capabilities

Requirements of the extractor.

func (FakeTestLayersExtractor) Version

func (e FakeTestLayersExtractor) Version() int

Version of the extractor.

Jump to

Keyboard shortcuts

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