initializers

package
v0.0.0-...-c717815 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DB *gorm.DB

Functions

func ConnectDB

func ConnectDB(config *Config) *gorm.DB

Types

type Config

type Config struct {
	DBHost         string `mapstructure:"POSTGRES_HOST"`
	DBUserName     string `mapstructure:"POSTGRES_USER"`
	DBUserPassword string `mapstructure:"POSTGRES_PASSWORD"`
	DBName         string `mapstructure:"POSTGRES_DB"`
	DBPort         string `mapstructure:"POSTGRES_PORT"`

	ServerPort        string `mapstructure:"PORT"`
	ClientOrigin      string `mapstructure:"CLIENT_ORIGIN"`
	Version           string `mapstructure:"VERSION"`
	City              string `mapstructure:"CITY_NAME"`
	OpenWeatherApiKey string `mapstructure:"OPEN_WEATHER_API_KEY"`
}

func LoadConfig

func LoadConfig(path string) (config Config, err error)

Jump to

Keyboard shortcuts

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