config

package
v0.0.0-...-a6ef0dd Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 9, 2020 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Server Server   `yaml:"server"`
	Params Params   `yaml:"params"`
	DB     Database `yaml:"database"`
	Redis  Redis    `yaml:"redis"`
}

type Database

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

type Params struct {
	ShortUrlLength int `yaml:"short_url_length"`
	ExpireDuration int `yaml:"expire_duration"` //days
}

type Redis

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

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"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL