add 'bool' type checker

This commit is contained in:
Adrien Marquès 2018-10-02 11:59:12 +02:00
parent 12ddf1feae
commit 93aa8b66dc
1 changed files with 24 additions and 0 deletions

View File

@ -0,0 +1,24 @@
package main
import (
"git.xdrm.io/go/aicra/driver"
)
func main() {}
func Export() driver.Checker { return new(BoolChecker) }
type BoolChecker int
// Match matches the string 'bool'
func (bck BoolChecker) Match(name string) bool {
return name == "bool"
}
// Check returns true for any type from the @validationTable
func (bck BoolChecker) Check(value interface{}) bool {
// check if bool
_, ok := value.(bool)
return ok
}