metrics

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: May 16, 2026 License: MIT Imports: 2 Imported by: 0

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:

  1. Parse(raw []byte) (Output, error) — strict-decode the judge's JSON response, returning a typed Output with all required fields validated.
  2. 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

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeStrict

func DecodeStrict(raw []byte, v any, prefix string) error

func MissingRequiredField

func MissingRequiredField(prefix, field string) error

func MissingRequiredNestedField

func MissingRequiredNestedField(prefix, kind string, index int, field string) error

func NestedRange01

func NestedRange01(prefix, kind string, index int, field string, value float64) error

func Range01

func Range01(prefix, field string, value float64) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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