config

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

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

Go to latest
Published: Feb 27, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CloseMongoDBConnection

func CloseMongoDBConnection(client *mongo.Client)

func InitDatabaseCollections

func InitDatabaseCollections(client *mongo.Client, dbName string)

InitDatabaseCollections inicializa as coleções e os indices necessários do banco de dados.

func InitDatabaseIndexes

func InitDatabaseIndexes(db *mongo.Database)

func NewMongoDatabase

func NewMongoDatabase(env *Env) *mongo.Client

Types

type Application

type Application struct {
	Env   *Env
	Mongo *mongo.Client
}

func App

func App() Application

func (*Application) CloseDBConnection

func (app *Application) CloseDBConnection()

type Env

type Env struct {
	AppEnv         string `mapstructure:"APP_ENV"`
	ServerAddress  string `mapstructure:"SERVER_ADDRESS"`
	ContextTimeout int    `mapstructure:"CONTEXT_TIMEOUT"`
	DBHost         string `mapstructure:"DB_HOST"`
	DBUser         string `mapstructure:"DB_USER"`
	DBPass         string `mapstructure:"DB_PASS"`
	DBName         string `mapstructure:"DB_NAME"`
	DBPort         string `mapstructure:"DB_PORT"`
}

func NewEnv

func NewEnv() *Env

Jump to

Keyboard shortcuts

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