Documentation
¶
Index ¶
- Constants
- func GetConfigName() string
- type CacheConfig
- type CacheType
- type Config
- type ConsoleLoggerConfig
- type DatabaseConfig
- type DatabaseType
- type FileLoggerConfig
- type GeocodingClientConfig
- type JWTConfig
- type LocaleConfig
- type LogEncoding
- type LogLevel
- type LoggerConfig
- type MigrationConfig
- type MinioS3Config
- type Mode
- type OTPConfig
- type OauthClientConfig
- type PostgresDatabaseConfig
- type PubSubConfig
- type PubSubType
- type RedisCacheConfig
- type RedisPubSubConfig
- type S3Config
- type S3Type
- type SecurityConfig
- type ServerConfig
- type SmtpConfig
- type TemplateConfig
- type WebsocketConfig
Constants ¶
View Source
const ( LocalMode = Mode("local") DevelopmentMode = Mode("development") ProductionMode = Mode("production") TestMode = Mode("test") )
View Source
const ( MemoryCacheType = CacheType("memory") RedisCacheType = CacheType("redis") RedisClusterCacheType = CacheType("redis_cluster") )
View Source
const ( MemoryPubSubType = PubSubType("memory") RedisPubSubType = PubSubType("redis") )
View Source
const ( LogLevelDebug = LogLevel("debug") LogLevelInfo = LogLevel("info") LogLevelWarn = LogLevel("warning") LogLevelError = LogLevel("error") )
View Source
const ( LogEncodingText = LogEncoding("text") LogEncodingJson = LogEncoding("json") )
View Source
const (
MinioS3Type = S3Type("minio")
)
View Source
const (
PostgresDatabaseType = DatabaseType("postgres")
)
Variables ¶
This section is empty.
Functions ¶
func GetConfigName ¶
func GetConfigName() string
Types ¶
type CacheConfig ¶
type CacheConfig struct {
TTL int `default:"120" validate:"required,min=0"`
Type CacheType `default:"memory" validate:"required,oneof=memory redis"`
Redis *RedisCacheConfig `validate:"required_if=Type redis"`
}
type Config ¶
type Config struct {
Server ServerConfig
Database DatabaseConfig
Cache CacheConfig
S3 S3Config
PubSub PubSubConfig
SMTP SmtpConfig
Websocket WebsocketConfig
Locale LocaleConfig
Template TemplateConfig
Migrations MigrationConfig
Logger LoggerConfig
OAuthClients map[string]OauthClientConfig
GeocodingClients map[string]GeocodingClientConfig
Security SecurityConfig
}
type ConsoleLoggerConfig ¶
type DatabaseConfig ¶
type DatabaseConfig struct {
Type DatabaseType `default:"postgres" validate:"required,oneof=postgres"`
Postgres *PostgresDatabaseConfig `validate:"required_if=Type postgres"`
}
type DatabaseType ¶
type DatabaseType string
type FileLoggerConfig ¶
type GeocodingClientConfig ¶
type GeocodingClientConfig struct {
APIKey string `validate:"required"`
}
type LocaleConfig ¶
type LogEncoding ¶
type LogEncoding string
type LoggerConfig ¶
type LoggerConfig struct {
Level string `default:"info" validate:"required"`
Console ConsoleLoggerConfig
File FileLoggerConfig
}
type MigrationConfig ¶
type MigrationConfig struct {
Path string `default:"migrations" validate:"required"`
}
type MinioS3Config ¶
type OauthClientConfig ¶
type PostgresDatabaseConfig ¶
type PubSubConfig ¶
type PubSubConfig struct {
Type PubSubType `default:"memory" validate:"required,oneof=memory redis"`
Redis *RedisPubSubConfig `validate:"required_if=Type redis"`
}
type PubSubType ¶
type PubSubType string
type RedisCacheConfig ¶
type RedisPubSubConfig ¶
type S3Config ¶
type S3Config struct {
Type S3Type `default:"minio" validate:"required,oneof=minio"`
Minio *MinioS3Config `validate:"required_if=Type minio"`
}
type SecurityConfig ¶
type ServerConfig ¶
type ServerConfig struct {
Name string `default:"server" validate:"required"`
Port int `default:"8000" validate:"min=-1,max=65535"`
ExternalOrigin string `default:"http://localhost:8080" validate:"omitempty,http_url"`
Mode Mode `default:"local" validate:"required,oneof=local development production test"`
Version string `default:"0.0.0"`
MaxRequestSize int `default:"524288000" validate:"min=0"`
RPS int `default:"100" validate:"required,min=1"`
}
type SmtpConfig ¶
type TemplateConfig ¶
type TemplateConfig struct {
Path string `default:"templates" validate:"required"`
}
type WebsocketConfig ¶
type WebsocketConfig struct {
PoolSize int `default:"1024" validate:"min=0"`
}
Click to show internal directories.
Click to hide internal directories.