Moved config structs to more logical location

This commit is contained in:
Jef Roosens 2022-04-06 18:20:14 +02:00
parent 2aa2aa143c
commit c656e672e2
Signed by untrusted user: Jef Roosens
GPG key ID: B75D4F293C7052DB
5 changed files with 23 additions and 25 deletions

View file

@ -3,6 +3,17 @@ module server
import cli
import env
struct Config {
pub:
log_level string = 'WARN'
log_file string = 'vieter.log'
pkg_dir string
download_dir string
api_key string
repo_dir string
repos_file string
}
// cmd returns the cli submodule that handles starting the server
pub fn cmd() cli.Command {
return cli.Command{
@ -10,7 +21,7 @@ pub fn cmd() cli.Command {
description: 'Start the Vieter server'
execute: fn (cmd cli.Command) ? {
config_file := cmd.flags.get_string('config-file') ?
conf := env.load<env.ServerConfig>(config_file) ?
conf := env.load<Config>(config_file) ?
server(conf) ?
}