mirror of
https://github.com/crazy-max/diun.git
synced 2025-12-25 06:49:28 +01:00
Configuration file not required anymore DIUN_DB env var renamed DIUN_DB_PATH Only accept duration as timeout value (10 becomes 10s) Add getting started doc Enhanced documentation Add note about test notifications (#79) Improve configuration management Fix telegram init All fields in configuration now camelCased Improve configuration validation Update doc Update FAQ Co-authored-by: CrazyMax <crazy-max@users.noreply.github.com>
27 lines
1.1 KiB
Go
27 lines
1.1 KiB
Go
package model
|
|
|
|
// NotifAmqp holds amqp notification configuration details
|
|
type NotifAmqp struct {
|
|
Username string `yaml:"username,omitempty" json:"username,omitempty" validate:"omitempty"`
|
|
UsernameFile string `yaml:"usernameFile,omitempty" json:"usernameFile,omitempty" validate:"omitempty,file"`
|
|
Password string `yaml:"password,omitempty" json:"password,omitempty" validate:"omitempty"`
|
|
PasswordFile string `yaml:"passwordFile,omitempty" json:"passwordFile,omitempty" validate:"omitempty,file"`
|
|
Host string `yaml:"host,omitempty" json:"host,omitempty" validate:"required"`
|
|
Port int `yaml:"port,omitempty" json:"port,omitempty" validate:"required"`
|
|
Queue string `yaml:"queue,omitempty" json:"queue,omitempty" validate:"required"`
|
|
Exchange string `yaml:"exchange,omitempty" json:"exchange,omitempty" validate:"omitempty"`
|
|
}
|
|
|
|
// GetDefaults gets the default values
|
|
func (s *NotifAmqp) GetDefaults() *NotifAmqp {
|
|
n := &NotifAmqp{}
|
|
n.SetDefaults()
|
|
return n
|
|
}
|
|
|
|
// SetDefaults sets the default values
|
|
func (s *NotifAmqp) SetDefaults() {
|
|
s.Host = "localhost"
|
|
s.Port = 5672
|
|
}
|