config

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2024 License: AGPL-3.0 Imports: 1 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 {
	Http     Http     `envconfig:"HTTP"`
	Database Database `envconfig:"DB"`
	LogLevel string   `envconfig:"LOG_LEVEL" default:"info"`
}

type Database

type Database struct {
	Host     string `envconfig:"HOST" default:"localhost"`
	Port     int    `validate:"required,min=1,max=65535" envconfig:"PORT" default:"5432"`
	User     string `validate:"required" envconfig:"USERNAME"`
	Password string `validate:"required" envconfig:"PASSWORD"`
	DBName   string `validate:"required" envconfig:"NAME"`
	SSLMode  string `envconfig:"SSL_MODE" default:"require"`
}

type Http

type Http struct {
	Port         int           `validate:"required,min=1,max=65535" envconfig:"PORT" default:"8085"`
	ReadTimeout  time.Duration `envconfig:"READ_TIMEOUT" default:"10s"`
	WriteTimeout time.Duration `envconfig:"WRITE_TIMEOUT" default:"60s"`
	IdleTimeout  time.Duration `envconfig:"IDLE_TIMEOUT" default:"60s"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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