示例#1
0
文件: dummy.go 项目: taoyonggang/fuji
func (device *DummyDevice) Validate() error {
	validator := validator.NewValidator()
	validator.SetValidationFunc("validtopic", inidef.ValidMqttPublishTopic)
	if err := validator.Validate(device); err != nil {
		return err
	}
	return nil
}
示例#2
0
// init is automatically invoked at initial time.
func init() {
	validator.SetValidationFunc("validtopic", inidef.ValidMqttPublishTopic)
}
示例#3
0
func init() {
	validator.SetValidationFunc("user_notstopword", notReservedWord)
}