chore: init monorepo
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
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
|
||||
}
|
||||
Reference in New Issue
Block a user