Validation framework with some default validators.
Go to file
Stanislav Nikitin d26b8f4262
continuous-integration/drone Build is passing Details
Switch to mirrorred images for Drone and Docker, make linters happy.
2022-06-29 15:32:54 +05:00
example Switch to mirrorred images for Drone and Docker, make linters happy. 2022-06-29 15:32:54 +05:00
validators Added licensing information (we're on MIT). Fixes #1. 2020-05-12 15:54:14 +05:00
.drone.yml Switch to mirrorred images for Drone and Docker, make linters happy. 2022-06-29 15:32:54 +05:00
.gitignore Drone fixes. 2021-11-20 01:48:55 +05:00
.golangci.yml Fix linting errors (#2). 2020-06-17 23:39:36 +05:00
LICENSE Added licensing information (we're on MIT). Fixes #1. 2020-05-12 15:54:14 +05:00
README.md godoc.org link and more drone CI recipe fixes. 2019-12-03 21:31:18 +05:00
debug.go Switch to mirrorred images for Drone and Docker, make linters happy. 2022-06-29 15:32:54 +05:00
errors.go Switch to mirrorred images for Drone and Docker, make linters happy. 2022-06-29 15:32:54 +05:00
go.mod Initial commit, valiwork as framework is ready to use. 2019-12-03 21:21:57 +05:00
go.sum Initial commit, valiwork as framework is ready to use. 2019-12-03 21:21:57 +05:00
validations.go Switch to mirrorred images for Drone and Docker, make linters happy. 2022-06-29 15:32:54 +05:00
validations_test.go Switch to mirrorred images for Drone and Docker, make linters happy. 2022-06-29 15:32:54 +05:00

README.md

ValiWork - validation framework

GoDoc Build Status Discord Keybase XLM

ValiWork is a validation framework that provides sane API and ability to write own validators that returns arbitrary things. It is goroutine-safe and fast.

Default validators

There are no necessity to enable default validators at all. But if you want to - call:

valiwork.InitializeDefaultValidators()

Default validators will return error.

There are no default validators ATM. Feel free to submit PR with them!

Validators registering and namespacing

Default validators using "T_N" scheme, where T is data type (string, int, int64, etc.) and N is a validator name (which can be a generic string). Please, use same naming scheme. Example good validators names:

  • string_check_for_very_rare_symbol_that_is_not_allowed
  • int64_check_if_in_bad_range
  • interface_check_if_able_to_be_TheVeryGoodStruct

Key idea is to help you debugging this thing (see debug section below).

Debug

Define VALIWORK_DEBUG environment variable and set it to true to get debug output. Default log module will be used for that.