database

package
v0.0.0-...-4e4842a Latest Latest
Warning

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

Go to latest
Published: May 4, 2016 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Database

type Database struct {
	Config        DatabaseConfig
	Connection    sql.DB
	ORMConnection gorm.DB
}

Database type

func (*Database) Connect

func (d *Database) Connect() error

Connect opens a new connection for SQL DB

func (*Database) ConnectORM

func (d *Database) ConnectORM() error

ConnectORM opens a new ORM connection to the database

func (*Database) SetConfig

func (d *Database) SetConfig(conf DatabaseConfig)

SetConfig is a setter for DatabaseConfig

type DatabaseConfig

type DatabaseConfig struct {
	Username string `json:"Username"`
	Password string `json:"Password"`
	Database string `json:"Database"`
	Host     string `json:"Host"`
}

DatabaseConfig is used for storing database credentials config

Jump to

Keyboard shortcuts

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