services

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: May 31, 2026 License: MIT Imports: 5 Imported by: 0 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

Index

Constants

This section is empty.

Variables

View Source
var ErrNilRedactor = errors.New("redactor must not be nil")

ErrNilRedactor is returned when Compare is called with a nil redactor.

Functions

This section is empty.

Types

type CompareResult

type CompareResult struct {
	Request traffictesting.RedactResult
	Live    traffictesting.RedactResult
	Shadow  traffictesting.RedactResult
	Ops     []diff.PatchOp
}

CompareResult holds all redacted results and the computed diff ops.

type ResponseComparer

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

ResponseComparer encapsulates the redact + envelope + diff pipeline.

func NewResponseComparer

func NewResponseComparer(redactor *traffictesting.Redactor, diffOpts []diff.Option) *ResponseComparer

NewResponseComparer creates a ResponseComparer with the given redactor and diff options.

func (*ResponseComparer) Compare

func (c *ResponseComparer) Compare(req, live, shadow ResponseData) (*CompareResult, error)

Compare redacts all three inputs, builds envelopes from live and shadow, and computes the diff between them.

Redaction errors are fatal (returned immediately). Diff errors are non-fatal (ops defaults to empty slice).

type ResponseData

type ResponseData struct {
	StatusCode int
	Headers    http.Header
	Body       []byte
}

ResponseData holds the raw inputs for one side of the comparison.

Jump to

Keyboard shortcuts

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