You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
570 B
Go
27 lines
570 B
Go
6 months ago
|
// Package config provides configuration structures and methods to load
|
||
|
// environment variables for the application.
|
||
|
package config
|
||
|
|
||
|
import (
|
||
|
"log"
|
||
|
|
||
|
"github.com/joho/godotenv"
|
||
|
)
|
||
|
|
||
|
// Config holds the configuration for the application, including the database settings. It contains multiple embedded configuration structs.
|
||
|
type Config struct {
|
||
|
Database
|
||
|
}
|
||
|
|
||
|
// New loads environment variables and returns a new configured Config instance.
|
||
|
func New() *Config {
|
||
|
err := godotenv.Load()
|
||
|
if err != nil {
|
||
|
log.Println(err)
|
||
|
}
|
||
|
|
||
|
return &Config{
|
||
|
Database: DataStore(),
|
||
|
}
|
||
|
}
|