Documentation ¶
Index ¶
Constants ¶
View Source
const ( DefaultConfigPath = "config.yaml" DefaultHTTPIPV4Host = "0.0.0.0" DefaultHTTPIPV6Host = "::" DefaultHTTPPort = 8080 DefaultHTTPMetricsIPV4Host = "127.0.0.1" DefaultHTTPMetricsIPV6Host = "::1" DefaultHTTPMetricsPort = 8081 DefaultPersistenceDatabaseDriver = DatabaseDriverSQLite DefaultPersistenceDatabaseDatabase = "rtz.db" DefaultPersistenceUploads = "uploads/" DefaultRegistrationEnabled = false DefaultRedisEnabled = false DefaultAuthGitHubEnabled = false DefaultAuthGoogleEnabled = false DefaultAuthCustomEnabled = false )
Variables ¶
View Source
var ( ConfigFileKey = "config" HTTPIPV4HostKey = "http.ipv4_host" HTTPIPV6HostKey = "http.ipv6_host" HTTPPortKey = "http.port" HTTPTracingEnabledKey = "http.tracing.enabled" HTTPTracingOTLPEndKey = "http.tracing.otlp_endpoint" HTTPPProfEnabledKey = "http.pprof.enabled" HTTPTrustedProxiesKey = "http.trusted_proxies" HTTPMetricsEnabledKey = "http.metrics.enabled" HTTPMetricsIPV4HostKey = "http.metrics.ipv4_host" HTTPMetricsIPV6HostKey = "http.metrics.ipv6_host" HTTPMetricsPortKey = "http.metrics.port" HTTPCORSHostsKey = "http.cors_hosts" HTTPFrontendURLKey = "http.frontend_url" HTTPBackendURLKey = "http.backend_url" PersistenceDatabaseDriverKey = "persistence.database.driver" PersistenceDatabaseDatabaseKey = "persistence.database.database" PersistenceDatabaseUsernameKey = "persistence.database.username" PersistenceDatabasePasswordKey = "persistence.database.password" PersistenceDatabaseHostKey = "persistence.database.host" PersistenceDatabasePortKey = "persistence.database.port" PersistenceDatabaseExtraParametersKey = "persistence.database.extra_parameters" PersistenceUploadsKey = "persistence.uploads" RegistrationEnabledKey = "registration.enabled" AuthGoogleEnabledKey = "auth.google.enabled" AuthGoogleClientIDKey = "auth.google.client_id" //nolint:golint,gosec AuthGoogleClientSecretKey = "auth.google.client_secret" AuthGitHubEnabledKey = "auth.github.enabled" AuthGitHubClientIDKey = "auth.github.client_id" //nolint:golint,gosec AuthGitHubClientSecretKey = "auth.github.client_secret" AuthCustomEnabledKey = "auth.custom.enabled" AuthCustomClientIDKey = "auth.custom.client_id" AuthCustomClientSecretKey = "auth.custom.client_secret" AuthCustomTokenURLKey = "auth.custom.token_url" AuthCustomUserURLKey = "auth.custom.user_url" JWTSecretKey = "jwt.secret" MapboxPublicTokenKey = "mapbox.public_token" MapboxSecretTokenKey = "mapbox.secret_token" RedisEnabledKey = "redis.enabled" RedisSentinelEnabledKey = "redis.sentinel.enabled" RedisSentinelMasterNameKey = "redis.sentinel.master_name" RedisSentinelAddressesKey = "redis.sentinel.addresses" RedisSentinelPasswordKey = "redis.sentinel.password" RedisSentinelUsernameKey = "redis.sentinel.username" RedisAddressKey = "redis.address" RedisUsernameKey = "redis.username" RedisPasswordKey = "redis.password" RedisDatabaseKey = "redis.database" )
View Source
var ( ErrJWTSecretRequired = errors.New("JWT secret is required") ErrBackendURLRequired = errors.New("Backend URL is required") ErrFrontendURLRequired = errors.New("Frontend URL is required") ErrOTLPEndpointRequired = errors.New("OTLP endpoint is required when tracing is enabled") ErrMapboxPublicTokenRequired = errors.New("Mapbox public token is required") ErrMapboxSecretTokenRequired = errors.New("Mapbox secret token is required") ErrDBHostRequired = errors.New("Database host is required") ErrDBDatabaseRequired = errors.New("Database name is required") ErrDatabaseDriverRequired = errors.New("Database driver is required") ErrRedisHostRequired = errors.New("Redis host is required") ErrRedisSentinelMasterRequired = errors.New("Redis Sentinel master is required") ErrRedisSentinelHostsRequired = errors.New("Redis Sentinel hosts are required") ErrGitHubOAuthRequired = errors.New("GitHub OAuth client ID and secret are required") ErrGoogleOAuthRequired = errors.New("Google OAuth client ID and secret are required") ErrCustomOAuthRequired = errors.New("Custom OAuth client ID and secret are required") ErrCustomTokenURLRequired = errors.New("Custom OAuth token URL is required") ErrCustomUserURLRequired = errors.New("Custom OAuth user URL is required") )
Functions ¶
func RegisterFlags ¶
Types ¶
type Config ¶
type Config struct { HTTP HTTP `json:"http"` Persistence Persistence `json:"persistence"` Registration Registration `json:"registration"` Auth Auth `json:"auth"` JWT JWT `json:"jwt"` Mapbox Mapbox `json:"mapbox"` Redis Redis `json:"redis"` }
type DatabaseDriver ¶ added in v0.0.139
type DatabaseDriver string
const ( DatabaseDriverSQLite DatabaseDriver = "sqlite" DatabaseDriverMySQL DatabaseDriver = "mysql" DatabaseDriverPostgres DatabaseDriver = "postgres" )
type HTTP ¶
type HTTP struct { HTTPListener Tracing FrontendURL string `json:"frontend_url" yaml:"frontend_url"` BackendURL string `json:"backend_url" yaml:"backend_url"` PProf PProf `json:"pprof"` TrustedProxies []string `json:"trusted_proxies" yaml:"trusted_proxies"` Metrics Metrics `json:"metrics"` CORSHosts []string `json:"cors_hosts" yaml:"cors_hosts"` }
type HTTPListener ¶
type Metrics ¶
type Metrics struct { HTTPListener Enabled bool `json:"enabled"` }
type Persistence ¶
type Registration ¶
type Registration struct {
Enabled bool `json:"enabled"`
}
Click to show internal directories.
Click to hide internal directories.