Documentation
¶
Overview ¶
Package metrics provides validation helpers shared by every built-in judge-metric sub-package under internal/metrics/*. The sub-packages follow a uniform shape that callers in the root gaugo package can compose generically:
- Parse(raw []byte) (Output, error) — strict-decode the judge's JSON response, returning a typed Output with all required fields validated.
- Score(...) float64 — optional aggregation when the metric score is derived from sub-fields (e.g. claim ratios, weighted averages).
The helpers in this file (DecodeStrict, Range01, MissingRequiredField, …) are deliberately small and side-effect free so they can be reused by future user-defined metrics. The sub-packages remain unexported in v1.x; a future release may promote them to a public extension surface.
Index ¶
- func DecodeStrict(raw []byte, v any, prefix string) error
- func MissingRequiredField(prefix, field string) error
- func MissingRequiredNestedField(prefix, kind string, index int, field string) error
- func NestedRange01(prefix, kind string, index int, field string, value float64) error
- func Range01(prefix, field string, value float64) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MissingRequiredField ¶
func NestedRange01 ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.