Intégration d'un point d'entrée GraphQL et d'un connecteur pour

PostgreSQL

- Possibilité de migrer le schéma de la base de données via drapeau
- Génération du code GraphQL avec https://gqlgen.com/
This commit is contained in:
2020-07-13 09:20:14 +02:00
parent 1120474ad9
commit 591112a800
28 changed files with 984 additions and 15 deletions

View File

@ -13,9 +13,11 @@ import (
)
type Config struct {
Log LogConfig `yaml:"log"`
HTTP HTTPConfig `yaml:"http"`
OIDC OIDCConfig `yaml:"oidc"`
Debug bool `yaml:"debug" env:"DEBUG"`
Log LogConfig `yaml:"log"`
HTTP HTTPConfig `yaml:"http"`
OIDC OIDCConfig `yaml:"oidc"`
Database DatabaseConfig `yaml:"database"`
}
// NewFromFile retrieves the configuration from the given file
@ -57,6 +59,10 @@ type LogConfig struct {
Format logger.Format `yaml:"format" env:"LOG_FORMAT"`
}
type DatabaseConfig struct {
DSN string `yaml:"dsn" env:"DATABASE_DSN"`
}
func NewDumpDefault() *Config {
config := NewDefault()
return config
@ -64,6 +70,7 @@ func NewDumpDefault() *Config {
func NewDefault() *Config {
return &Config{
Debug: false,
Log: LogConfig{
Level: logger.LevelInfo,
Format: logger.FormatHuman,
@ -82,6 +89,9 @@ func NewDefault() *Config {
RedirectURL: "http://localhost:8081/oauth2/callback",
PostLogoutRedirectURL: "http://localhost:8081",
},
Database: DatabaseConfig{
DSN: "host=localhost database=daddy",
},
}
}