mirror of
https://github.com/crazy-max/diun.git
synced 2025-12-25 14:59:33 +01:00
Allow to configure scheme for MQTT broker (#292)
This commit is contained in:
committed by
GitHub
parent
456b1f5e5c
commit
b912aee5e4
@@ -1,6 +1,7 @@
|
||||
package model
|
||||
|
||||
type NotifMqtt struct {
|
||||
Scheme string `yaml:"scheme,omitempty" json:"scheme,omitempty" validate:"required,oneof=mqtt mqtts ws wss"`
|
||||
Host string `yaml:"host,omitempty" json:"host,omitempty" validate:"required"`
|
||||
Port int `yaml:"port,omitempty" json:"port,omitempty" validate:"required,min=1"`
|
||||
Username string `yaml:"username,omitempty" json:"username,omitempty" validate:"omitempty"`
|
||||
@@ -21,6 +22,7 @@ func (s *NotifMqtt) GetDefaults() *NotifMqtt {
|
||||
|
||||
// SetDefaults sets the default values
|
||||
func (s *NotifMqtt) SetDefaults() {
|
||||
s.Scheme = "mqtt"
|
||||
s.Host = "localhost"
|
||||
s.Port = 1883
|
||||
s.QoS = 0
|
||||
|
||||
Reference in New Issue
Block a user