Discover Packages
github.com/alnovi/sso
internal
config
package
Version:
v0.0.0-...-69e7fd1
Opens a new window with list of versions in this module.
Published: Jun 12, 2024
License: MIT
Opens a new window with license information.
Imports: 1
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
Documentation
¶
View Source
const (
EnvProduction = "production"
EnvTesting = "testing"
KeyEnvironment key = iota
KeyClientAdminID
KeyClientProfileID
KeyUserAdminID
KeyUserAdminEmail
)
type App struct {
Environment string `env:"ENVIRONMENT,default=production"`
Host string `env:"HOST"`
Shutdown time .Duration `env:"SHUTDOWN,default=5s"`
}
type Client struct {
AdminID string `env:"ADMIN_ID,default=00000000-0000-0000-0000-000000000001"`
ProfileID string `env:"PROFILE_ID,default=00000000-0000-0000-0000-000000000002"`
}
type Config struct {
App App `env:",prefix=APP_"`
Log Log `env:",prefix=LOG_"`
Mail Mail `env:",prefix=MAIL_"`
DB DB `env:",prefix=DB_"`
Http Http `env:",prefix=HTTP_"`
Cors Cors `env:",prefix=CORS_"`
Client Client `env:",prefix=CLIENT_"`
User User `env:",prefix=USER_"`
}
type Cors struct {
AllowOrigin string `env:"ALLOW_ORIGIN"`
}
type DB struct {
Host string `env:"HOST,default=localhost"`
Port string `env:"PORT,default=5432"`
Database string `env:"DATABASE,default=example"`
User string `env:"USER,default=example"`
Password string `env:"PASSWORD,default=secret"`
SSL bool `env:"SSL,default=false"`
}
type Http struct {
Host string `env:"HOST,default=0.0.0.0"`
Port string `env:"PORT,default=8080"`
}
type Log struct {
Format string `env:"FORMAT,default=json"`
Level string `env:"LEVEL,default=error"`
}
type Mail struct {
FromName string `env:"NAME,default=SSO"`
FromAddr string `env:"FROM,default=sso@example.com"`
Host string `env:"HOST,default=localhost"`
Port string `env:"PORT,default=5432"`
User string `env:"USER,default=example"`
Password string `env:"PASSWORD,default=example"`
}
type User struct {
AdminID string `env:"ADMIN_ID,default=00000000-0000-0000-0000-000000000001"`
AdminEmail string `env:"ADMIN_EMAIL,default=admin@example.com"`
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.