mirror of
https://github.com/crazy-max/diun.git
synced 2025-12-24 06:28:13 +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>
28 lines
926 B
Go
28 lines
926 B
Go
package model
|
|
|
|
import (
|
|
"github.com/crazy-max/diun/v3/pkg/utl"
|
|
)
|
|
|
|
// PrdSwarm holds swarm provider configuration
|
|
type PrdSwarm struct {
|
|
Endpoint string `yaml:"endpoint,omitempty" json:"endpoint,omitempty" validate:"omitempty"`
|
|
APIVersion string `yaml:"apiVersion,omitempty" json:"apiVersion,omitempty" validate:"omitempty"`
|
|
TLSCertsPath string `yaml:"tlsCertsPath,omitempty" json:"tlsCertsPath,omitempty" validate:"omitempty"`
|
|
TLSVerify *bool `yaml:"tlsVerify,omitempty" json:"tlsVerify,omitempty" validate:"required"`
|
|
WatchByDefault *bool `yaml:"watchByDefault,omitempty" json:"watchByDefault,omitempty" validate:"required"`
|
|
}
|
|
|
|
// GetDefaults gets the default values
|
|
func (s *PrdSwarm) GetDefaults() *PrdSwarm {
|
|
n := &PrdSwarm{}
|
|
n.SetDefaults()
|
|
return n
|
|
}
|
|
|
|
// SetDefaults sets the default values
|
|
func (s *PrdSwarm) SetDefaults() {
|
|
s.TLSVerify = utl.NewTrue()
|
|
s.WatchByDefault = utl.NewFalse()
|
|
}
|