config

package
v0.0.0-...-7c907d4 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2021 License: MIT Imports: 4 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 *ServerConfig
	DB     *DBConfig
}

func GetConfig

func GetConfig() (*Config, error)

type DBConfig

type DBConfig struct {
	Host         string        `default:"localhost"`
	Port         uint16        `default:"5432"`
	Name         string        `default:"shortener"`
	User         string        `default:"shortener"`
	Password     string        `default:"123456789"`
	SSLMode      string        `envconfig:"ssl_mode" default:"verify-full"`
	QueryTimeout time.Duration `default:"500ms"`
}

type ServerConfig

type ServerConfig struct {
	Port            uint16        `default:"8000"`
	IdleTimeout     time.Duration `default:"2m"`
	ReadTimeout     time.Duration `default:"5s"`
	WriteTimeout    time.Duration `default:"5s"`
	ShutdownTimeout time.Duration `default:"15s"`
}

Jump to

Keyboard shortcuts

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