Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
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).