Skip to content

Lightweight and extensible input validation library for Go. Supports custom rules, error localization, and simple API.

License

Notifications You must be signed in to change notification settings

debuggers-dev/mobikit-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mobikit Validator for Go

Mobikit is a lightweight, extensible, and developer-friendly input validation library for Go.
It enables you to define flexible validation rules for user inputs or any dynamic data source, with support for custom rules, clean API, and localization.

Whether you're building RESTful APIs, CLI tools, or backend systems, Mobikit gives you an easy way to keep your inputs clean and predictable.


✨ Features

  • ✅ Simple and intuitive API
  • 🧩 Custom rule support
  • 🌍 Localization-ready (JSON-based error messages)
  • 🧪 Easy to test and extend
  • 📦 Lightweight, zero external dependencies

📦 Installation

To install the package:

go get -u github.com/Armnajafi/mobikit-go

Sample usage

package main

import (
	mobikit_go "github.com/Armnajafi/mobikit-go"
	"github.com/Armnajafi/mobikit-go/rules"
)

func main() {
	validator := mobikit_go.NewValidator()

	emailRule := rules.EmailRule{
		Message: "Invalid email address",
	}

	rulesMap := map[string]mobikit_go.Rule{
		"email": emailRule,
	}

	inputs := map[string]interface{}{
		"email": "test@example.com",
	}
	result := validator.Validate(inputs, rulesMap)
	if !result.IsValid {
		print("email is invalid")
	}
}

About

Lightweight and extensible input validation library for Go. Supports custom rules, error localization, and simple API.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages