package main

import (
	// External
	"github.com/go-yaml/yaml"

	// Standard
	"os"
)

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

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

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

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