Discover Packages
github.com/ridwanakf/url-shortener-service
internal
app
config
package
Version:
v0.0.0-...-a6ef0dd
Opens a new window with list of versions in this module.
Published: Aug 9, 2020
License: MIT
Opens a new window with license information.
Imports: 0
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
Documentation
¶
type Config struct {
Server Server `yaml:"server"`
Params Params `yaml:"params"`
DB Database `yaml:"database"`
Redis Redis `yaml:"redis"`
}
type Database struct {
Address string `yaml:"address" env:"DATABASE_URL"`
Driver string `yaml:"driver" env:"DATABASE_DRIVER"`
MaxConns int `yaml:"max_conns" env:"DATABASE_MAX_CONNS"`
MaxIdleConns int `yaml:"max_idle_conns" env:"DATABASE_MAX_IDLE"`
}
type Params struct {
ShortUrlLength int `yaml:"short_url_length"`
ExpireDuration int `yaml:"expire_duration"`
}
type Redis struct {
Address string `yaml:"address" env:"REDIS_URL"`
Timeout int `yaml:"timeout" env:"REDIS_TIMEOUT"`
MaxIdle int `yaml:"max_idle" env:"REDIS_MAX_IDLE"`
MaxActive int `yaml:"max_active" env:"REDIS_MAX_ACTIVE"`
}
type Server struct {
Port string `yaml:"port" env:"PORT"`
Debug bool `yaml:"debug" env:"DEBUG"`
ReadTimeoutSeconds int `yaml:"read_timeout_seconds" env:"SERVER_READ_TIMEOUT"`
WriteTimeoutSeconds int `yaml:"write_timeout_seconds" env:"SERVER_READ_TIMEOUT"`
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.