Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BuildConfig ¶
type BuildConfig struct {
// BuildDir is path to directory to cache WebAssembly builds
BuildDir string `envconfig:"APP_BUILD_DIR" json:"buildDir"`
// PackagesFile is path to packages JSON index file
PackagesFile string `envconfig:"APP_PKG_FILE" json:"packagesFile"`
// CleanupInterval is WebAssembly build artifact cache clean interval
CleanupInterval time.Duration `envconfig:"APP_CLEAN_INTERVAL" json:"cleanupInterval"`
// BypassEnvVarsList is allow-list of environment variables
// that will be passed to Go compiler.
//
// Empty value disables environment variable filter.
BypassEnvVarsList []string `envconfig:"APP_PERMIT_ENV_VARS" json:"bypassEnvVarsList"`
}
type Config ¶
type Config struct {
HTTP HTTPConfig `json:"http"`
Playground PlaygroundConfig `json:"playground"`
Build BuildConfig `json:"build"`
Log LogConfig `json:"log"`
Services ServicesConfig `json:"services"`
}
func FromEnv ¶
FromEnv populates config with values from environment variables.
If passed config is nil - a new config will be returned.
func FromFlagSet ¶
FromFlagSet returns config file which will read values from flags when flag.Parse will be called.
type HTTPConfig ¶
type LogConfig ¶
type LogConfig struct {
Debug bool `envconfig:"APP_DEBUG" json:"debug"`
Level zapcore.Level `envconfig:"APP_LOG_LEVEL" json:"level"`
Format string `envconfig:"APP_LOG_FORMAT" json:"format"`
Sentry SentryConfig `json:"sentry"`
}
type PlaygroundConfig ¶
type PlaygroundConfig struct {
// PlaygroundURL is Go playground server URL
PlaygroundURL string `envconfig:"APP_PLAYGROUND_URL" json:"playgroundUrl"`
// ConnectTimeout is HTTP request timeout for playground requests
ConnectTimeout time.Duration `envconfig:"APP_PLAYGROUND_TIMEOUT" json:"connectTimeout"`
}
type SentryConfig ¶
type ServicesConfig ¶
type ServicesConfig struct {
// GoogleAnalyticsID is Google Analytics tag ID (optional)
GoogleAnalyticsID string `envconfig:"APP_GTAG_ID" json:"googleAnalyticsID"`
}
Click to show internal directories.
Click to hide internal directories.