conf

package
v0.0.0-...-e8a075a Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetupLogging

func SetupLogging(config MiscConf)

Types

type MiscConf

type MiscConf struct {
	DebugLogging bool
	Logfile      string
}

type MqttConf

type MqttConf struct {
	Url      string
	Username string
	Password string
	// if empty, the system certificates are used
	CertFile string

	Topics MqttTopicsConf
}

type MqttTopicsConf

type MqttTopicsConf struct {
	SpaceInternalBrokerTopic string
	Devices                  string

	StateSpace       string
	StateSpaceNext   string
	StateRadstelle   string
	StateLab3d       string
	StateMachining   string
	StateWoodworking string

	EnergyFront     string
	EnergyBack      string
	EnergyMachining string

	KeyholderId              string
	KeyholderName            string
	KeyholderNameMachining   string
	KeyholderNameWoodworking string

	BackdoorBoltContact string
}

type MySqlConf

type MySqlConf struct {
	Host                     string
	User                     string
	Password                 string
	Database                 string
	SaveDevicesIntervalInSec int
}

type StdErrLogHook

type StdErrLogHook struct {
}

A hook that prints logs with level Warn and up always to the stderr, even if a log file is written.

func (*StdErrLogHook) Fire

func (h *StdErrLogHook) Fire(entry *logrus.Entry) error

func (*StdErrLogHook) Levels

func (h *StdErrLogHook) Levels() []logrus.Level

type TomlConfig

type TomlConfig struct {
	Mqtt    MqttConf
	MySql   MySqlConf
	Twitter TwitterConf
	Web     WebServiceConf
	Misc    MiscConf
}

func LoadConfig

func LoadConfig(configFile string) TomlConfig

type TwitterConf

type TwitterConf struct {
	Mocking           bool // # if true, it does everthing except the actual tweet. Useful for developing.
	Enabled           bool
	TwitterdelayInSec int // delay tweeting after space state change for this long; it's also the minimum time between two tweets
	// auth
	ConsumerKey       string
	ConsumerSecret    string
	AccessTokenKey    string
	AccessTokenSecret string
}

type WebServiceConf

type WebServiceConf struct {
	Host           string
	Port           int
	SwitchPassword string // to change a status on the /switch page
}

Jump to

Keyboard shortcuts

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