config: add fields
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
leo 2023-04-23 19:23:00 +02:00
parent e58c15f1c9
commit 70ec7f5e53
Signed by: wanderer
SSH Key Fingerprint: SHA256:Dp8+iwKHSlrMEHzE3bJnPng70I7LEsa3IJXRH/U+idQ
2 changed files with 11 additions and 7 deletions

@ -49,7 +49,8 @@ let Config =
, AppName : Text , AppName : Text
, LiveMode : Bool , LiveMode : Bool
, DevelMode : Bool , DevelMode : Bool
, LoginCookieName : Optional Text , SessionCookieName : Text
, SessionCookieSecret : Text
} }
let defconf let defconf
@ -61,7 +62,8 @@ let defconf
, AppName = "pcmt" , AppName = "pcmt"
, LiveMode = False , LiveMode = False
, DevelMode = False , DevelMode = False
, LoginCookieName = None Text , SessionCookieName = "sessionz"
, SessionCookieSecret = "secret"
} }
let conf let conf
@ -88,4 +90,4 @@ let _ =
-- | validate the configuration. -- | validate the configuration.
assert : Config/validate conf assert : Config/validate conf
in nuconf in conf

@ -11,6 +11,8 @@ type Config struct {
AppName string AppName string
LiveMode bool LiveMode bool
DevelMode bool DevelMode bool
SessionCookieName string
SessionCookieSecret string
} }
func LoadConfig(path string) (*Config, error) { func LoadConfig(path string) (*Config, error) {