config

package
v0.0.0-...-92b6a08 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2023 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetDbConnection

func GetDbConnection(cfg AppConfig, logger *Logger) *pgx.Conn

Types

type AppConfig

type AppConfig struct {
	Environment string `mapstructure:"environment"`
	Port        int    `mapstructure:"port"`
	Log         Log    `mapstructure:"log"`
	Db          Db     `mapstructure:"db"`
}

func GetConfig

func GetConfig(configFilePath string) (AppConfig, error)

type Db

type Db struct {
	Host     string `mapstructure:"host"`
	Port     int    `mapstructure:"port"`
	Username string `mapstructure:"username"`
	Password string `mapstructure:"password"`
	Database string `mapstructure:"database"`
}

type Log

type Log struct {
	Level string `mapstructure:"level"`
	File  string `mapstructure:"file"`
}

type Logger

type Logger struct {
	*zap.SugaredLogger
}

func NewLogger

func NewLogger(cfg AppConfig) *Logger

Jump to

Keyboard shortcuts

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