Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/debug-ing/validation-go
This is an initial project for validation
https://github.com/debug-ing/validation-go
Last synced: 7 days ago
JSON representation
This is an initial project for validation
- Host: GitHub
- URL: https://github.com/debug-ing/validation-go
- Owner: debug-ing
- Created: 2024-11-15T03:40:32.000Z (2 months ago)
- Default Branch: master
- Last Pushed: 2024-11-15T05:14:11.000Z (2 months ago)
- Last Synced: 2024-11-15T05:27:27.434Z (2 months ago)
- Language: Go
- Size: 0 Bytes
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# validation-go
This project is a simple system for validating user inputs in Go. It allows you to define rules for fields and validate that data meets certain conditions. It provides easy-to-understand error messages for invalid inputs.This project is currently in development, and additional features will be added soon, including more validation rules and improved error handling. Future updates may include support for more complex validation scenarios, extended field types, and greater flexibility in customization.
Stay tuned for upcoming enhancements!
## Strings:
| Tag | Description |
| - | - |
| boolean | Boolean |
| contains | Contains |
| notcontains | not Contains |
| numeric | Numeric |## Network:
| Tag | Description |
| - | - |
| ip | Internet Protocol Address IP |
| ipv4 | Internet Protocol Address IPv4 |
| ipv6 | Internet Protocol Address IPv6 |
| mac | Media Access Control Address MAC |
| uri | URI String |
| url | URL String |## Other:
| Tag | Description |
| - | - |
| required | Required |
| optional | Optional |## Add Custom Validator:
```go
validation.AddCustomValidator("test", "%s vard kon", validateRequired)func validateRequired(value string, errorMsg string) error {
if value == "" {
fmt.Println(errorMsg)
return errors.New(errorMsg)
}
return nil
}```
## more
I developed this project to deepen my understanding of Go and its capabilities. It's an opportunity for me to explore Go's features and enhance my skills in building more efficient and flexible systems.
## Missing
- [ ] Add Unit tests.