Help us shape the future of Go! Take the 2026 Go Developer Survey

config

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConnectDB

func ConnectDB(cfg *MongoConfig) (*mongo.Database, error)

ConnectDB establishes connection to MongoDB

Types

type Config

type Config struct {
	AppName       string
	Version       string
	Port          string
	Environment   string
	Description   string
	MongoURI      string
	MongoDatabase string
}

func LoadConfig

func LoadConfig() (*Config, error)

type MongoConfig

type MongoConfig struct {
	URI      string
	Database string
	Timeout  time.Duration
}

MongoConfig holds MongoDB configuration

func NewMongoConfig

func NewMongoConfig() *MongoConfig

NewMongoConfig creates a new MongoDB configuration

Jump to

Keyboard shortcuts

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