feat: initial commit
This commit is contained in:
25
internal/config/config.go
Normal file
25
internal/config/config.go
Normal file
@ -0,0 +1,25 @@
|
||||
package config
|
||||
|
||||
import (
|
||||
"github.com/caarlos0/env/v11"
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
type Config struct {
|
||||
Logger Logger `envPrefix:"LOGGER_"`
|
||||
Auth Auth `envPrefix:"AUTH_"`
|
||||
HTTP HTTP `envPrefix:"HTTP_"`
|
||||
LLM LLM `envPrefix:"LLM_"`
|
||||
Store Store `envPrefix:"STORE_"`
|
||||
}
|
||||
|
||||
func Parse() (*Config, error) {
|
||||
conf, err := env.ParseAsWithOptions[Config](env.Options{
|
||||
Prefix: "KOUIZ_",
|
||||
})
|
||||
if err != nil {
|
||||
return nil, errors.WithStack(err)
|
||||
}
|
||||
|
||||
return &conf, nil
|
||||
}
|
Reference in New Issue
Block a user