Documentation
¶
Overview ¶
Copyright (c) 2024 Eli Janssen Use of this source code is governed by an MIT-style license that can be found in the LICENSE file.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EnvConfig ¶
type EnvConfig struct {
// general
Production bool `env:"PRODUCTION" envDefault:"true"`
RpcApi bool `env:"ENABLE_RPC" envDefault:"false"`
BaseURL string `env:"BASE_URL,required"`
// logging
LogFormat string `env:"LOG_FORMAT" envDefault:"json"`
LogLevel slog.Level `env:"LOG_LEVEL" envDefault:"info"`
LogTrace bool `env:"LOG_TRACE" envDDefault:"false"`
// tls/quic
TLSCert string `env:"TLS_CERT,unset"`
TLSKey string `env:"TLS_KEY,unset"`
WithQuic bool `env:"QUIC" envDefault:"false"`
// static files and templates
TemplateDir string `env:"TPL_DIR" envDefault:"embed"`
StaticDir string `env:"STATIC_DIR" envDefault:"embed"`
// database connectivity
DatabaseDSN string `env:"DB_DSN,required,unset"`
RedisDSN string `env:"REDIS_DSN,required,unset"`
// email settings
SMTPHostname string `env:"SMTP_HOSTNAME,required"`
SMTPHost string `env:"SMTP_HOST,expand" envDefault:"$SMTP_HOSTNAME"`
SMTPPort int `env:"SMTP_PORT,required"`
SMTPUser string `env:"SMTP_USER,required"`
SMTPPass string `env:"SMTP_PASS,required,unset"`
MailFrom string `env:"MAIL_FROM,required"`
// webhook settings
WebhookCreds map[string]string `env:"WEBHOOK_CREDS,unset"`
// values derived from other env vars (deriveConfig)
Listen string
HMACKeyBytes []byte
}
Click to show internal directories.
Click to hide internal directories.