Help us shape the future of Go! Take the 2026 Go Developer Survey

validate

package
v0.17.0 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package validate provides input validation functions for the obol CLI. Each function returns nil on success or a descriptive error.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Name

func Name(s string) error

Name validates a resource name (k8s-safe DNS label).

func Price

func Price(s string) error

Price validates a paid decimal price string exactly (no float parsing): plain digits with an optional single '.', at most 18 fractional digits (the most any ERC-20 token has), greater than zero and at most schemas.MaxPriceWholeTokens. Signs, exponents, Inf/NaN, commas and currency symbols are rejected. Free routes use gate=free, not a zero price.

func PriceForToken added in v0.17.0

func PriceForToken(s string, decimals int, symbol string) error

PriceForToken is Price limited to the settlement token's decimals, e.g. "0.0000001" is rejected for USDC (6 decimals) with "max 6 decimal places for USDC".

func URL

func URL(s string) error

URL validates a URL string.

Types

This section is empty.

Jump to

Keyboard shortcuts

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