validate

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package validate holds the error types services use to reject input, so the HTTP layer can map them the same way for every module: a FieldError per bad field (422) and RateLimitError (429).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FieldError

type FieldError struct {
	Field   string
	Message string
}

FieldError rejects one input field; the API reports it as a validation error.

func FieldErrors

func FieldErrors(err error) []*FieldError

FieldErrors returns every FieldError in err (validation joins one per bad field).

func (*FieldError) Error

func (e *FieldError) Error() string

type RateLimitError

type RateLimitError struct {
	RetryAfter time.Duration
}

RateLimitError means too many attempts; retry after RetryAfter.

func (*RateLimitError) Error

func (e *RateLimitError) Error() string

Jump to

Keyboard shortcuts

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