schema

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 17, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetConstraint

func GetConstraint(constraint *float64, fallback float64) float64

GetConstraint extracts a constraint value, returning fallback if nil.

func ToFloat64

func ToFloat64(v *int) *float64

ToFloat64 safely converts an int pointer to float64 pointer.

Types

type MinMax

type MinMax struct {
	Min *float64
	Max *float64
}

MinMax represents minimum and maximum bounds for a numeric value.

func DefaultMinMax

func DefaultMinMax(minVal, maxVal float64) MinMax

DefaultMinMax returns default min/max values when constraints are not specified.

func ExtractMinMax

func ExtractMinMax(minVal, maxVal *int, minFallback, maxFallback float64) MinMax

ExtractMinMax extracts min and max values from int pointers, converting to float64.

func NewMinMax

func NewMinMax(minVal, maxVal *float64) MinMax

NewMinMax creates a new MinMax with the provided min and max values.

func (MinMax) Contains

func (m MinMax) Contains(value float64) bool

Contains checks if a value is within the min/max bounds.

func (MinMax) IsEmpty

func (m MinMax) IsEmpty() bool

IsEmpty checks if both min and max are nil (no constraints).

func (MinMax) Range

func (m MinMax) Range() float64

Range returns the total range (max - min) if both values exist.

Jump to

Keyboard shortcuts

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