http-validate

command
v2.0.3 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

This has the same logic as the http-inline example but it has implemented validator.Validator and as such requests can be checked in a single place. In this case, in a ParseRequest function will decode the json responses and check that the request is a validator.

If it is, the validator will be evaluated and if a failure is found ie if Err() returns a non nil response, an error is returned.

As is shown, this can then be checked in an error handler and a response created and returned.

Jump to

Keyboard shortcuts

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