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