configValidator

package module
v0.0.0-...-5230e68 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2017 License: MIT Imports: 2 Imported by: 2

README

Struct validator for golang

Another dumb library on the topic


import (
		"github.com/Ajnasz/config-validator"

		"log"
)
type Config struct {
	Foo string `required:"true"`
	Bar int `required:"true"`
}


func main() {
	config := Config{}
	err := configValidator.Validate(config)

	if err != nil {
		log.Fatal(err)
	}
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Validate

func Validate(config interface{}) error

Validate Validates the configuration

Types

This section is empty.

Jump to

Keyboard shortcuts

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