Documentation
¶
Index ¶
- type Config
- func (c *Config) D1Parts() (accountID, databaseID string, err error)
- func (c *Config) DatabaseType() string
- func (c *Config) GetAPIAllowedIPs() []string
- func (c *Config) GetAPICORSOrigins() []string
- func (c *Config) GetAPIToken() string
- func (c *Config) GetAdminAllowedIPs() []string
- func (c *Config) GetAllowedIPs() []string
- func (c *Config) GetD1APIToken() string
- func (c *Config) GetD1BaseURL() string
- func (c *Config) GetResolvedDatabaseURL() string
- func (c *Config) GetTLSMaterialSource() (string, error)
- func (c *Config) GetTursoAuthToken() string
- func (c *Config) IsDevelopment() bool
- func (c *Config) IsProduction() bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Addr string `mapstructure:"REDGE_ADDR" validate:"required"`
HTTPEnabled bool `mapstructure:"REDGE_HTTP_ENABLED"`
HTTPAddr string `mapstructure:"REDGE_HTTP_ADDR" validate:"required"`
AdminEnabled bool `mapstructure:"REDGE_ADMIN_ENABLED"`
AdminAddr string `mapstructure:"REDGE_ADMIN_ADDR" validate:"required"`
Environment string `mapstructure:"REDGE_ENV" validate:"required,oneof=development test production"`
LogLevel string `mapstructure:"REDGE_LOG_LEVEL" validate:"required,oneof=debug info warn error"`
LogFormat string `mapstructure:"REDGE_LOG_FORMAT" validate:"required,oneof=json console"`
ShutdownTimeout time.Duration `mapstructure:"REDGE_SHUTDOWN_TIMEOUT"`
Password string `mapstructure:"REDGE_PASSWORD"`
APIToken string `mapstructure:"REDGE_API_TOKEN"`
RequireAuth bool `mapstructure:"REDGE_REQUIRE_AUTH"`
ProtectedMode bool `mapstructure:"REDGE_PROTECTED_MODE"`
AllowedIPs string `mapstructure:"REDGE_ALLOWED_IPS"`
MaxConnections int `mapstructure:"REDGE_MAX_CONNECTIONS" validate:"min=0"`
AuthFailureDelay time.Duration `mapstructure:"REDGE_AUTH_FAILURE_DELAY"`
TLSEnabled bool `mapstructure:"REDGE_TLS_ENABLED"`
TLSCertPEM string `mapstructure:"REDGE_TLS_CERT_PEM"`
TLSKeyPEM string `mapstructure:"REDGE_TLS_KEY_PEM"`
TLSCertB64 string `mapstructure:"REDGE_TLS_CERT_B64"`
TLSKeyB64 string `mapstructure:"REDGE_TLS_KEY_B64"`
TLSCertFile string `mapstructure:"REDGE_TLS_CERT_FILE"`
TLSKeyFile string `mapstructure:"REDGE_TLS_KEY_FILE"`
TLSMinVersion string `mapstructure:"REDGE_TLS_MIN_VERSION" validate:"oneof=1.2 1.3"`
MaxRequestBytes int64 `mapstructure:"REDGE_MAX_REQUEST_BYTES" validate:"min=1024"`
ReadTimeout time.Duration `mapstructure:"REDGE_READ_TIMEOUT"`
WriteTimeout time.Duration `mapstructure:"REDGE_WRITE_TIMEOUT"`
DatabaseURL string `mapstructure:"DATABASE_URL" validate:"required"`
TursoAuthToken string `mapstructure:"TURSO_AUTH_TOKEN"`
D1APIToken string `mapstructure:"D1_API_TOKEN"`
D1BaseURL string `mapstructure:"D1_BASE_URL"`
D1RetryMax int `mapstructure:"D1_RETRY_MAX" validate:"min=0"`
D1RetryMinBackoff time.Duration `mapstructure:"D1_RETRY_MIN_BACKOFF"`
D1RetryMaxBackoff time.Duration `mapstructure:"D1_RETRY_MAX_BACKOFF"`
DatabaseMaxOpenConns int `mapstructure:"DATABASE_MAX_OPEN_CONNS" validate:"min=1"`
DatabaseMaxIdleConns int `mapstructure:"DATABASE_MAX_IDLE_CONNS" validate:"min=1"`
DatabaseConnMaxLife time.Duration `mapstructure:"DATABASE_CONN_MAX_LIFETIME"`
MigrationsAuto bool `mapstructure:"REDGE_MIGRATIONS_AUTO"`
CacheEnabled bool `mapstructure:"REDGE_CACHE_ENABLED"`
CacheMaxKeys int `mapstructure:"REDGE_CACHE_MAX_KEYS" validate:"min=1"`
CacheMaxBytes int64 `mapstructure:"REDGE_CACHE_MAX_BYTES" validate:"min=1"`
CacheDefaultTTL time.Duration `mapstructure:"REDGE_CACHE_DEFAULT_TTL"`
ExpiryCleanupEnabled bool `mapstructure:"REDGE_EXPIRY_CLEANUP_ENABLED"`
ExpiryCleanupInterval time.Duration `mapstructure:"REDGE_EXPIRY_CLEANUP_INTERVAL"`
ExpiryCleanupLimit int `mapstructure:"REDGE_EXPIRY_CLEANUP_LIMIT" validate:"min=1"`
AdminToken string `mapstructure:"REDGE_ADMIN_TOKEN"`
AdminAllowedIPs string `mapstructure:"REDGE_ADMIN_ALLOWED_IPS"`
AdminIPCheckEnabled bool `mapstructure:"REDGE_ADMIN_IP_CHECK_ENABLED"`
AdminReadOnly bool `mapstructure:"REDGE_ADMIN_READONLY"`
APIMaxBodyBytes int64 `mapstructure:"REDGE_API_MAX_BODY_BYTES" validate:"min=1024"`
APIAllowedIPs string `mapstructure:"REDGE_API_ALLOWED_IPS"`
APIIPCheckEnabled bool `mapstructure:"REDGE_API_IP_CHECK_ENABLED"`
APICORSEnabled bool `mapstructure:"REDGE_API_CORS_ENABLED"`
APICORSOrigins string `mapstructure:"REDGE_API_CORS_ORIGINS"`
APIRateLimit bool `mapstructure:"REDGE_API_RATE_LIMIT_ENABLED"`
APIRateLimitRPS int `mapstructure:"REDGE_API_RATE_LIMIT_RPS" validate:"min=1"`
APIRateLimitBurst int `mapstructure:"REDGE_API_RATE_LIMIT_BURST" validate:"min=1"`
DocAPIEnabled bool `mapstructure:"REDGE_DOCAPI_ENABLED"`
WSEnabled bool `mapstructure:"REDGE_WS_ENABLED"`
WSMaxBytes int64 `mapstructure:"REDGE_WS_MAX_MESSAGE_BYTES" validate:"min=1024"`
WSIdleTimeout time.Duration `mapstructure:"REDGE_WS_IDLE_TIMEOUT"`
WSMaxSubs int `mapstructure:"REDGE_WS_MAX_SUBSCRIPTIONS" validate:"min=1"`
StoreAPIEnabled bool `mapstructure:"REDGE_STOREAPI_ENABLED"`
}
func (*Config) DatabaseType ¶
func (*Config) GetAPIAllowedIPs ¶
func (*Config) GetAPICORSOrigins ¶
func (*Config) GetAPIToken ¶
func (*Config) GetAdminAllowedIPs ¶
func (*Config) GetAllowedIPs ¶
func (*Config) GetD1APIToken ¶
func (*Config) GetD1BaseURL ¶
func (*Config) GetResolvedDatabaseURL ¶
func (*Config) GetTLSMaterialSource ¶
func (*Config) GetTursoAuthToken ¶
func (*Config) IsDevelopment ¶
func (*Config) IsProduction ¶
Click to show internal directories.
Click to hide internal directories.