db

package
v0.0.0-...-f90f44b Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2018 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrCanNotConnectWithDatabase = errors.New("Can not connect with database")

ErrCanNotConnectWithDatabase error if database is unreachable

View Source
var ErrUserNotFound = errors.New("User does not exist")

ErrUserNotFound error if user does not exist in database

Functions

func CloseConnection

func CloseConnection(db *sql.DB)

CloseConnection closes the connection to the database

func GetUserByUsername

func GetUserByUsername(db *sql.DB, username string) (models.User, error)

GetUserByUsername return the models.User object based on the username

func OpenConnection

func OpenConnection(cnf config.Config) (*sql.DB, error)

OpenConnection opens the connection to the database

Types

This section is empty.

Jump to

Keyboard shortcuts

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