2018-05-22 18:27:51 +00:00
|
|
|
package main
|
|
|
|
|
2018-05-28 16:25:17 +00:00
|
|
|
import (
|
2018-10-02 09:10:21 +00:00
|
|
|
"git.xdrm.io/go/aicra/driver"
|
2018-05-28 16:25:17 +00:00
|
|
|
)
|
|
|
|
|
2018-10-02 09:10:21 +00:00
|
|
|
func main() {}
|
|
|
|
func Export() driver.Checker { return new(StringChecker) }
|
|
|
|
|
|
|
|
type StringChecker int
|
|
|
|
|
|
|
|
func (sck StringChecker) Match(name string) bool {
|
2018-05-22 18:27:51 +00:00
|
|
|
return name == "string"
|
|
|
|
}
|
|
|
|
|
2018-10-02 09:10:21 +00:00
|
|
|
func (sck StringChecker) Check(value interface{}) bool {
|
2018-05-22 18:27:51 +00:00
|
|
|
|
2018-05-31 07:23:30 +00:00
|
|
|
if value == nil {
|
|
|
|
return false
|
|
|
|
}
|
|
|
|
|
2018-10-02 09:50:01 +00:00
|
|
|
_, ok := value.(string)
|
2018-05-28 16:25:17 +00:00
|
|
|
|
2018-10-02 09:50:01 +00:00
|
|
|
return ok
|
2018-05-28 16:25:17 +00:00
|
|
|
|
2018-05-22 18:27:51 +00:00
|
|
|
}
|