configuration

package
v0.0.0-...-e64aa6a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 23, 2018 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Connector ConnectorConfig `json:"connector"`
	Logging   LoggingConfig   `json:"logging"`
}

Config contains the settings for the connector

func GetConfig

func GetConfig(cfgFile string) (Config, error)

GetConfig retrieves a new configuration from the given config file returns an error when config does not exist or cannot be read or validated

func (Config) Validate

func (c Config) Validate() error

Validate checks if all mandatory params are set in the config

type ConnectorConfig

type ConnectorConfig struct {
	Host                  string `json:"host"`
	Port                  int    `json:"port"`
	ModulePath            string `json:"modulePath"`
	StartModulesOnStartup bool   `json:"startModulesOnStartup"`
}

ConnectorConfig contains the general config information

type DiscordConfig

type DiscordConfig struct {
	Enabled bool   `json:"enabled"`
	Hook    string `json:"hook"`
	Name    string `json:"name"`
}

DiscordConfig contains the discord logging configuration

type LoggingConfig

type LoggingConfig struct {
	Status  StatusConfig  `json:"status"`
	Discord DiscordConfig `json:"discord"`
}

LoggingConfig contains logging settings

type StatusConfig

type StatusConfig struct {
	Enabled         bool `json:"enabled"`
	IntervalSeconds int  `json:"intervalSeconds"`
}

StatusConfig contains the status report configuration

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL