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
Arrayfunc
Boolfunc
Floatfunc
Intz.number().min(18)func
MustValidatefuncMustValidate panics if validation fails.
ObjectFieldfuncObjectField nests an object schema as a field.
ParseJSONfuncParseJSON decodes JSON from r into v and validates struct tags on v.
Stringz.string().email()func
ValidatefuncValidate runs struct-tag validation on structs.
ValidateSchemaschema.parse(data)funcValidateSchema validates v against sch (map or struct).

Types

SymbolNode.jsKindSummary
FieldtypeField validates a single value in a programmatic schema.
SchematypeSchema is a map-based object schema (Joi.object).
ValidationErrortypeValidationError 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