Documentation ¶
Index ¶
- Constants
- type Configuration
- func (c *Configuration) DeleteUnknownSeeds(db database.ReadWriter)
- func (c *Configuration) LoadFromFile(path string) error
- func (c *Configuration) SaveChecks(w database.Writer) error
- func (c *Configuration) SaveContactGroups(w database.Writer) error
- func (c *Configuration) SaveContacts(w database.Writer) error
- func (c *Configuration) SaveHosts(w database.Writer) error
- type HTTP
- type HTTPRedirect
Constants ¶
View Source
const (
// DefaultPath is the default location for the config file.
DefaultPath = "/etc/gansoi.yml"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Configuration ¶
type Configuration struct { Bind string `json:"bind"` DataDir string `json:"datadir"` HTTP HTTP `json:"http"` HTTPRedirect HTTPRedirect `json:"redirect"` ExclusiveSeeding bool `json:"exclusive-seeding"` Hosts map[string]ssh.SSH `json:"hosts"` Checks map[string]*checks.Check `json:"checks"` ContactGroups map[string]*notify.ContactGroup `json:"contactgroups"` Contacts map[string]*notify.Contact `json:"contacts"` // contains filtered or unexported fields }
Configuration keeps configuration for a core node.
func NewConfiguration ¶
func NewConfiguration() *Configuration
NewConfiguration returns a new configuration with sane defaults.
func (*Configuration) DeleteUnknownSeeds ¶
func (c *Configuration) DeleteUnknownSeeds(db database.ReadWriter)
DeleteUnknownSeeds deletes all checks, hosts, contacts and contactgroups not seeded from the configuration.
func (*Configuration) LoadFromFile ¶
func (c *Configuration) LoadFromFile(path string) error
LoadFromFile loads a configuration from path.
func (*Configuration) SaveChecks ¶
func (c *Configuration) SaveChecks(w database.Writer) error
SaveChecks will save all checks from the configuration to the supplied database.Writer.
func (*Configuration) SaveContactGroups ¶
func (c *Configuration) SaveContactGroups(w database.Writer) error
func (*Configuration) SaveContacts ¶
func (c *Configuration) SaveContacts(w database.Writer) error
type HTTP ¶
type HTTP struct { TLS bool `json:"tls"` Bind string `json:"bind"` Hostnames []string `json:"hostnames"` CertPath string `json:"cert"` KeyPath string `json:"key"` Login string `json:"login"` Password string `json:"password"` }
HTTP configures the HTTP server.
type HTTPRedirect ¶
HTTPRedirect is the configuration for a HTTP redirector.
Click to show internal directories.
Click to hide internal directories.