fake

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2026 License: Apache-2.0 Imports: 4 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 fake provides a conflict.Analyzer that decorates an existing analyzer: it delegates to the wrapped implementation for the happy path, but injects an error when a caller-supplied predicate matches.

Unlike the change-facing fakes, Analyze operates on batches — it never sees change URIs — so error injection is predicate-driven rather than marker-driven. To exercise the analyzer's error path in e2e, route a queue to an analyzer built with a failing predicate (e.g. FailAlways) via the queue wiring. It is intended for examples and tests only, never production.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FailAlways

func FailAlways(entity.Batch, []entity.Batch) bool

FailAlways is a FailOn that injects an error on every Analyze call.

func New

func New(delegate conflict.Analyzer, failOn FailOn) conflict.Analyzer

New returns a conflict.Analyzer that delegates to the given analyzer but returns an error when failOn reports true for the call's inputs. The delegate is the existing analyzer implementation to wrap (e.g. all or none). A nil failOn never injects an error (pure passthrough).

Types

type FailOn

type FailOn func(batch entity.Batch, inFlight []entity.Batch) bool

FailOn decides whether Analyze should inject an error for the given inputs.

Jump to

Keyboard shortcuts

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