fakedetector

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package fakedetector provides a Detector implementation to be used in tests.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(name string, version int, finding *detector.Finding, err error) detector.Detector

New returns a fake detector.

The detector returns the specified Finding or error.

func NewWithOptions added in v0.1.1

func NewWithOptions(opts ...Option) detector.Detector

NewWithOptions creates a new fake detector with its properties set according to opts.

Types

type Option added in v0.1.1

type Option func(*fakeDetector)

Option is an option that can be set when creating a new fake detector

func WithErr added in v0.1.1

func WithErr(err error) Option

WithErr sets the fake detector's error that is returned when Scan() is called.

func WithFinding added in v0.1.1

func WithFinding(finding *detector.Finding) Option

WithFinding sets the fake detector's finding that is returned when Scan() is called.

func WithName added in v0.1.1

func WithName(name string) Option

WithName sets the fake detector's name.

func WithRequiredExtractors added in v0.1.1

func WithRequiredExtractors(extractors ...string) Option

WithRequiredExtractors sets the fake detector's required extractors.

func WithVersion added in v0.1.1

func WithVersion(version int) Option

WithVersion sets the fake detector's version.

Jump to

Keyboard shortcuts

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