package config

import (
	"errors"
	"os"
)

type Config struct {
	BaseDir string
	DBPath  string
}

func Load() (*Config, error) {
	dir := os.Getenv("BASE_PATH")
	db := os.Getenv("DB_LINK")

	if dir == "" || db == "" {
		return nil, errors.New("must set BASE_PATH and DB_LINK in env")
	}

	return &Config{
		BaseDir: dir,
		DBPath:  db,
	}, nil
}
