fakeextractor

package
v0.5.4 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2026 License: Apache-2.0, BSD-3-Clause, MIT Imports: 8 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package fakeextractor provides a Extractor implementation to be used in tests.

Index

Constants

This section is empty.

Variables

View Source
var AllowUnexported = cmp.AllowUnexported(fakeExtractor{})

AllowUnexported is a utility function to be used with cmp.Diff to compare structs that contain the fake extractor.

Functions

func New

func New(name string, version int, requiredFiles []string, pathToNamesErr map[string]NamesErr) filesystem.Extractor

New returns a fake fakeExtractor.

The fakeExtractor returns FileRequired(path) = true for any path in requiredFiles. The fakeExtractor returns the package and error from pathToNamesErr given the same path to Extract(...).

func NewDirExtractor added in v0.3.5

func NewDirExtractor(name string, version int, requiredFiles []string, pathToNamesErr map[string]NamesErr) filesystem.Extractor

NewDirExtractor returns a fake fakeExtractor designed for extracting directories.

The fakeExtractor returns FileRequired(path) = true for any path in requiredFiles. The fakeExtractor returns the package and error from pathToNamesErr given the same path to Extract(...).

func NewWithRequirements added in v0.5.2

func NewWithRequirements(name string, version int, requiredFiles []string, pathToNamesErr map[string]NamesErr, reqs *plugin.Capabilities) filesystem.Extractor

NewWithRequirements returns a fake fakeExtractor with custom requirements.

The fakeExtractor returns FileRequired(path) = true for any path in requiredFiles. The fakeExtractor returns the package and error from pathToNamesErr given the same path to Extract(...).

Types

type NamesErr

type NamesErr struct {
	Names []string
	Err   error
}

NamesErr is a list of Package names and an error.

Jump to

Keyboard shortcuts

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