Documentation
¶
Index ¶
Constants ¶
View Source
const ( LogLevelDebug = "DEBUG" LogLevelInfo = "INFO" LogLevelWarn = "WARN" LogLevelError = "ERROR" )
View Source
const ( LogFormatText = "text" LogFormatJson = "json" )
Variables ¶
View Source
var ( VERSION = "dev" COMMIT = "unknown" )
Functions ¶
This section is empty.
Types ¶
type AdminConfig ¶
type AdminConfig struct {
Listen string `yaml:"listen"`
}
func (AdminConfig) IsEnabled ¶
func (cfg AdminConfig) IsEnabled() bool
func (AdminConfig) Validate ¶
func (cfg AdminConfig) Validate() error
type Config ¶
type Config struct { Log LogConfig `yaml:"log" envconfig:"LOG"` DatabaseConfig DatabaseConfig `yaml:"database" envconfig:"DATABASE"` RedisConfig RedisConfig `yaml:"redis" envconfig:"REDIS"` AdminConfig AdminConfig `yaml:"admin" envconfig:"ADMIN"` ProxyConfig ProxyConfig `yaml:"proxy" envconfig:"PROXY"` WorkerConfig WorkerConfig `yaml:"worker" envconfig:"WORKER"` }
func InitWithFile ¶
type DatabaseConfig ¶
type DatabaseConfig struct { Host string `yaml:"host" default:"localhost"` Port uint32 `yaml:"port" default:"5432"` Username string `yaml:"username" default:"webhookx"` Password string `yaml:"password" default:""` Database string `yaml:"database" default:"webhookx"` }
func (DatabaseConfig) Validate ¶
func (cfg DatabaseConfig) Validate() error
type LogConfig ¶
type ProxyConfig ¶
type ProxyConfig struct { Listen string `yaml:"listen"` TimeoutRead int64 `yaml:"timeout_read" default:"10"` TimeoutWrite int64 `yaml:"timeout_write" default:"10"` MaxRequestBodySize int64 `yaml:"max_request_body_size" default:"1048576"` Response ProxyResponse `yaml:"response"` Queue Queue `yaml:"queue"` }
func (ProxyConfig) IsEnabled ¶
func (cfg ProxyConfig) IsEnabled() bool
func (ProxyConfig) Validate ¶
func (cfg ProxyConfig) Validate() error
type ProxyResponse ¶
type Queue ¶
type Queue struct {
Redis RedisConfig `yaml:"redis"`
}
type RedisConfig ¶
type RedisConfig struct { Host string `yaml:"host" default:"localhost"` Port uint32 `yaml:"port" default:"6379"` Password string `yaml:"password" default:""` Database uint32 `yaml:"database" default:"0"` }
func (RedisConfig) GetClient ¶
func (cfg RedisConfig) GetClient() *redis.Client
func (RedisConfig) Validate ¶
func (cfg RedisConfig) Validate() error
type WorkerConfig ¶
type WorkerConfig struct {
Enabled bool `yaml:"enabled" default:"false"`
}
func (*WorkerConfig) Validate ¶
func (cfg *WorkerConfig) Validate() error
Source Files
¶
Click to show internal directories.
Click to hide internal directories.