package main

import (
	// Standard
	"encoding/json"
	"os"
)

type Config struct {
	Network struct {
		Address string
		Port    int
	}

	Database struct {
		Host     string
		Port     int
		Db       string
		Username string
		Password string
	}

	JWT struct {
		Secret     string
		ExpireDays int
	}

	Storage struct {
		Files string
	}
}

func readConfig(fname string) (err error) {
	var configData []byte
	configData, err = os.ReadFile(fname)
	if err != nil {
		return
	}

	err = json.Unmarshal(configData, &config)
	return
}
