Example #1
0
func (device *DummyDevice) Validate() error {
	validator := validator.NewValidator()
	validator.SetValidationFunc("validtopic", inidef.ValidMqttPublishTopic)
	if err := validator.Validate(device); err != nil {
		return err
	}
	return nil
}
Example #2
0
// init is automatically invoked at initial time.
func init() {
	validator.SetValidationFunc("validtopic", inidef.ValidMqttPublishTopic)
}
Example #3
0
func init() {
	validator.SetValidationFunc("user_notstopword", notReservedWord)
}