Init
This commit is contained in:
commit
5e19a4e603
8 changed files with 93 additions and 0 deletions
15
lib/common.pkl
Normal file
15
lib/common.pkl
Normal file
|
@ -0,0 +1,15 @@
|
|||
class ServerConfig {
|
||||
host: String
|
||||
port: UInt16
|
||||
}
|
||||
|
||||
/// Set to a user and a group to drop privileges to after binding to the port
|
||||
class PermissionsConfig {
|
||||
user: String
|
||||
group: String
|
||||
}
|
||||
|
||||
class LoggingConfig {
|
||||
level: "TRACE"|"DEBUG"|"INFO"|"WARN"|"ERROR"|"FATAL"
|
||||
file: String
|
||||
}
|
17
lib/controller.pkl
Normal file
17
lib/controller.pkl
Normal file
|
@ -0,0 +1,17 @@
|
|||
import "./common.pkl"
|
||||
|
||||
server: common.ServerConfig
|
||||
|
||||
database: String
|
||||
|
||||
permissions: common.PermissionsConfig
|
||||
|
||||
logging: common.LoggingConfig
|
||||
|
||||
class RelayConfig {
|
||||
driver: "null"|"gpio"|"piface"
|
||||
pin: Number
|
||||
inverted: Boolean
|
||||
pulse: Number(this >= 0)|Null = null
|
||||
}
|
||||
relays: Listing<RelayConfig>
|
12
lib/core.pkl
Normal file
12
lib/core.pkl
Normal file
|
@ -0,0 +1,12 @@
|
|||
import "./common.pkl"
|
||||
|
||||
server: common.ServerConfig
|
||||
|
||||
database: String
|
||||
|
||||
permissions: common.PermissionsConfig
|
||||
|
||||
logging: common.LoggingConfig
|
||||
|
||||
/// Leave empty to allow all origins (will always respond with Origin and not "*")
|
||||
origins: Listing<String>
|
Loading…
Add table
Add a link
Reference in a new issue