...

Package db

import "ssa/mod_analyst/pkg/db"
Overview
Index

Overview ▾

func AddUser

func AddUser(user UserInfo, connectionInfo DbInfo)

AddUser *

* Add a user to the qa_staff table in the database
*
* @param name a string with the name of the person to be added
* @param is_aod a bool to check if the user is an AOD or not
* @param db_info a DbInfo type with information to connect to the database
*

func GetConnection

func GetConnection(db_info DbInfo) *sql.DB

*

* Establish a connection to the database
*
* @param db_info A DbInfo type with information to connect to the database
* @return A DB object with an open connection to the database
*

func RemoveUser

func RemoveUser(user UserInfo, connectionInfo DbInfo)

RemoveUser *

* Remove a user from the qa_staff table in the database
*
* @param name a string with the name of the person to be removed
* @param db_info a DbInfo type with information to connect to the database
*

type DbInfo

type DbInfo struct {
    Host        string
    Port        int
    User        string
    Password    string
    Dbname      string
    Profile     string
    IsSsl       bool
    AltCapoPath string
}

type UserInfo

type UserInfo struct {
    Name  string
    Email string
    IsAod bool
}