vBool

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2018 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Bool Validators

Index

Constants

View Source
const (
	Type = "bool"

	MandatoryErrorFormat = "Needs to be ticked."
)

Variables

This section is empty.

Functions

func Must

func Must(value bool, err error) bool

func Validate

func Validate(value bool, rules ...ValidationRule) (bool, error)

func ValidateFromString

func ValidateFromString(src string, rules ...ValidationRule) (bool, error)

Types

type ValidationRule

type ValidationRule func(src *string, value *bool, hasError bool) error

func Mandatory

func Mandatory() ValidationRule

Make sure value is true. Leave this rule to last.

func TrueIfMatches

func TrueIfMatches(match string) ValidationRule

If the src matches, set value to true.

Jump to

Keyboard shortcuts

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