Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ContainerBuildTime time.Time // Does not need UTC conversion, done by docker build
View Source
var DefaultConfig = Config{ Db: DbConfig{ Host: "localhost", Username: "mstar-server", Password: "mstar-server", DbName: "mstar-server", Port: 5432, SslMode: nil, TimeZone: nil, }, Oidc: OidcConfig{ IssuerUrl: "http://localhost:9000/", ClientId: "your client id here", ClientSecret: "your client secret here", }, BindAddress: ":8080", }
View Source
var IsDev = os.Getenv("DEV") == "true"
View Source
var LastModifiedTime time.Time
View Source
var StartupTime = time.Now().UTC()
Functions ¶
func SetupHttpClient ¶
func SetupHttpClient() error
Types ¶
type Config ¶
type Config struct {
Db DbConfig `toml:"db" yaml:"db" json:"db" kdl:"db" envPrefix:"DB_"`
BindAddress string `toml:"bindAddress" yaml:"bindAddress" json:"bindAddress" kdl:"bindAddress" env:"BIND_ADDRESS"`
Oidc OidcConfig `toml:"oidc" yaml:"oidc" json:"oidc" kdl:"oidc" envPrefix:"OIDC"`
}
var Global Config
type DbConfig ¶
type DbConfig struct {
Host string `toml:"host" yaml:"host" json:"host" kdl:"host" env:"HOST"`
Username string `toml:"username" yaml:"username" json:"username" kdl:"username" env:"USERNAME"`
Password string `toml:"password" yaml:"password" json:"password" kdl:"password" env:"PASSWORD"`
DbName string `toml:"dbName" yaml:"dbName" json:"dbName" kdl:"dbName" env:"DB_NAME"`
Port int `toml:"port" yaml:"port" json:"port" kdl:"port" env:"PORT"`
SslMode *string `toml:"sslMode" yaml:"sslMode" json:"sslMode" kdl:"sslMode" env:"SSL_MODE"`
TimeZone *string `toml:"timeZone" yaml:"timeZone" json:"timeZone" kdl:"timeZone" env:"TIME_ZONE"`
}
func (*DbConfig) BuildPostgresDSN ¶
type OidcConfig ¶
type OidcConfig struct {
// Url to the oidc discovery document
// Does not include the .well-known/openid-configuration part
IssuerUrl string `kdl:"issuerUrl" json:"issuerUrl" yaml:"issuerUrl" toml:"issuerUrl" env:"ISSUER_URL"`
ClientId string `kdl:"clientId" json:"clientId" yaml:"clientId" toml:"clientId" env:"CLIENT_ID"`
ClientSecret string `kdl:"clientSecret" json:"clientSecret" yaml:"clientSecret" toml:"clientSecret" env:"CLIENT_SECRET"`
}
Click to show internal directories.
Click to hide internal directories.