conf

package
v1.0.1-0...-497af47 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2020 License: CC-BY-SA-4.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Cfg *ini.File

Cfg represents the pointer to configuration file

View Source
var DB *sqlx.DB

DB - Represents SQLX database connection

Functions

func DSN

func DSN() string

DSN - Gets database connection string

func GetDB

func GetDB() (*sqlx.DB, error)

GetDB - Gets Database connection

func GetMongoCollection

func GetMongoCollection(collectionName string) (*mgo.Collection, error)

GetMongoCollection gets a data collection

func GetMongoSession

func GetMongoSession() (*mgo.Session, error)

GetMongoSession gets connection to Mongo repo

func LoadMongoConfig

func LoadMongoConfig()

LoadMongoConfig Init MongoDB Connection

Types

type Database

type Database interface {
	DSN() string
	GetDB() (*sqlx.DB, error)
}

Database - Database connection and configuration

type DbConnInfo

type DbConnInfo struct {
	DBType string
	User   string
	Pw     string
	DBName string
	Host   string
	Port   string
}

DbConnInfo - Database Connection information

var DBConnData *DbConnInfo

DBConnData - Value of database connection information

func LoadDbConfig

func LoadDbConfig() (dbConnectionInfo *DbConnInfo)

LoadDbConfig - Loads specific database connection information

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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