sonarqube-badges/config/config.go
2025-03-13 08:25:39 +01:00

23 lines
499 B
Go

package config
import (
"context"
"github.com/kelseyhightower/envconfig"
)
type Config struct {
SqHost string `envconfig:"SQ_HOST"`
AppPassword string `envconfig:"APP_PASSWORD"`
Secret string `envconfig:"SECRET"`
DataPath string `envconfig:"DATA_PATH"`
}
func ProcessConfiguration(ctx context.Context) context.Context {
var cfg Config
err := envconfig.Process("", &cfg)
if err != nil {
panic("failed to process config")
}
return context.WithValue(ctx, "config", cfg)
}