config

package
v0.0.0-...-8597337 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const LocalEnv = "local"

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	HTTP     HTTP
	Mongodb  Mongo
	Logger   Logger
	Postgres Postgres
}

func ParseFrom

func ParseFrom(path string) (*Config, error)

type HTTP

type HTTP struct {
	Port            string
	ReadTimeout     time.Duration
	WriteTimeout    time.Duration
	ShutdownTimeout time.Duration
	AllowedOrigins  []string
}

type Logger

type Logger struct {
	Lib   LoggerLib
	Level LoggerLevel
}

type LoggerLevel

type LoggerLevel = string
const (
	DebugLevel LoggerLevel = "DEBUG"
	InfoLevel  LoggerLevel = "INFO"
	WarnLevel  LoggerLevel = "WARN"
	ErrorLevel LoggerLevel = "ERROR"
	FatalLevel LoggerLevel = "FATAL"
)

type LoggerLib

type LoggerLib = string
const Zap LoggerLib = "zap"

type Mongo

type Mongo struct {
	URI               string
	DatabaseName      string
	Username          string
	Password          string
	DisconnectTimeout time.Duration
}

type Postgres

type Postgres struct {
	Host         string
	Port         string
	UserName     string
	Password     string
	DataBaseName string
	SslMode      bool
}

Jump to

Keyboard shortcuts

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