config

package
v0.0.59 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2022 License: GPL-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitLogger

func InitLogger(logger *logrus.Logger)

func ReadConfigFile

func ReadConfigFile() error

func RunSetup

func RunSetup() error

Used for setting up a Smarthome server quickly Reads a setup file at startup and starts functions that initialize those values in the database

func RunSetupStruct added in v0.0.48

func RunSetupStruct(setup SetupStruct) error

Types

type Config

type Config struct {
	Server   ServerConfig            `json:"server"`
	Database database.DatabaseConfig `json:"database"`
}

func GetConfig

func GetConfig() Config

type ServerConfig

type ServerConfig struct {
	Production bool   `json:"production"`
	SessionKey string `json:"sessionKey"` // Can be used to specify a manual session key
	Port       uint16 `json:"port"`
}

type SetupStruct added in v0.0.48

type SetupStruct struct {
	Users               []setupUser           `json:"users"`
	Rooms               []setupRoom           `json:"rooms"`
	HardwareNodes       []setupHardwareNode   `json:"hardwareNodes"`
	ServerConfiguration database.ServerConfig `json:"serverConfiguration"`
}

func Export added in v0.0.48

func Export() (SetupStruct, error)

Jump to

Keyboard shortcuts

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