comparisoninternal

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Plan

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

Plan binds JavaScript comparator declarations to one reflected schema. It is immutable after construction and safe to share across comparisons.

func NewPlan

func NewPlan(loaded *schema.Schema, fields, messages, rpcs []string) (*Plan, error)

NewPlan resolves and validates every declared comparator target before activation.

func (*Plan) Compare

func (p *Plan) Compare(
	ctx context.Context,
	log *slog.Logger,
	evaluator *javascript.Evaluator,
	method protoreflect.MethodDescriptor,
	runComparators bool,
	referenceJSON, candidateJSON []byte,
) (differences []string, err error)

Compare applies the plan to one response pair using the request's evaluator.

func (*Plan) Schema

func (p *Plan) Schema() *schema.Schema

Schema returns the descriptor schema bound to the plan.

Jump to

Keyboard shortcuts

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