https://github.com/trapcodeio/abolish-go
A Performance first variable validator for golang
https://github.com/trapcodeio/abolish-go
Last synced: 3 months ago
JSON representation
A Performance first variable validator for golang
- Host: GitHub
- URL: https://github.com/trapcodeio/abolish-go
- Owner: trapcodeio
- Created: 2022-12-12T21:32:25.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-12-14T14:57:39.000Z (over 2 years ago)
- Last Synced: 2025-03-20T05:34:53.562Z (3 months ago)
- Language: Go
- Size: 12.7 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# Abolish GoLang Version
## What is this?
An attempt to make a GoLang version of the Abolish project.## Why?
### Concept
The current validators in GoLang have some downsides that i cannot change.
The concept of abolish will provide a better way to validate data.## Downsides
Most validators do reflect at runtime, which is not a good thing.
abolish will not do this, which will make it faster at runtime.No way to define errors at runtime. 😩
## Solution
Compile functions will be provided to compile rules and generate a single function to use at runtime.## How?
The abolish package will provide a way to validate data in a more flexible way.```go
// rules via string
var rule = abolish.StringToRules("required|string|min:3|max:10")// rules via maps
var ruleMap = map[string]any{
"required": true,
"string": true,
"min": 3,
"max": 10,
}// rules via structs
type Rule struct {
// Note Tag `abolish` is customisable
Email string `abolish:"required|email"`
}
```## When?
I am not sure when this will be finished, but i will try to make it as soon as possible.
For now it will only progress as i use it.