Skip to content
Node: zod, joi14 APIs

validate

Package validate provides Zod/Joi-like validation on top of go-playground/validator. Node equivalent: zod, joi, yup

import "github.com/sahilkhaire/gox/validate"
## API reference

Select a symbol below — each page explains what it does, shows Node.js vs Go comparisons, and includes a runnable example.

Functions ​

SymbolNode.jsKindSummary
Array—func
Bool—func
Float—func
Intz.number().min(18)func
MustValidate—funcMustValidate panics if validation fails.
ObjectField—funcObjectField nests an object schema as a field.
ParseJSON—funcParseJSON decodes JSON from r into v and validates struct tags on v.
Stringz.string().email()func
Validate—funcValidate runs struct-tag validation on structs.
ValidateSchemaschema.parse(data)funcValidateSchema validates v against sch (map or struct).

Types ​

SymbolNode.jsKindSummary
Field—typeField validates a single value in a programmatic schema.
Schema—typeSchema is a map-based object schema (Joi.object).
ValidationError—typeValidationError holds human-readable validation messages.

Methods ​

SymbolNode.jsKindSummary
Schema.Objectz.object({...})methodObject builds a schema from field definitions.

MIT Licensed · Built for Node.js developers moving to Go