Documentation ¶
Overview ¶
* File: user Description: Implements features for an unique user including passwords @author Bryan Conn @date 10/7/2018
Index ¶
- Constants
- Variables
- func Backup(acBackupPath string)
- func CheckPassword(asUser User, acPassword string) bool
- func Issue(err error, acPath string)
- func Log(acLog string, anLogLevel LogLevel, acPath string)
- func MakeUser(acUsername string, acPassword string) (int, string)
- func ParseDateStrings(acTime time.Time) (string, string, string)
- type Audit
- type Date
- type Drug
- type DrugDB
- type LogLevel
- type NewDrug
- type Order
- type Prescription
- type Purchase
- type User
Constants ¶
const ( DEBUG LogLevel = 0 SQL = 1 INFO = 2 WARNING = 3 ERROR = 4 FATAL = 5 )
const ( UE = 0 // Empty Username US = 1 // Username contains spaces PE = 2 // Empty Password PS = 3 // Password contains spaces PIV = 4 // Password too long or short TN = 5 // Taken Name GOOD = 6 // No Issues )
* Declares constants that determine the validity of an entered password
Variables ¶
var GcLogDir string
var GpcFile *os.File
var Initial bool
var McConnStr string
Database password needs to be changed when released
var McDatabase string
var McDb *sql.DB
var McHost string
var McPassword string
var McPort string
var McRouter *mux.Router
var McUsername string
Functions ¶
func CheckPassword ¶
* Function: CheckPassword Description: Determines if the password matches the users password @param asUser The user that is being checked @param acPassword The password that was entered @return If the password matches
Types ¶
type Audit ¶
type Audit struct { McNdc string McPharmacist string McYear string McMonth string McDay string MnAuditQuantity float64 }
* Audit struct contains an audited quantity, the pharmacist who performed the audit, the date the audit was performed and the ndc of the audited drug
func MakeAudit ¶
func MakeAudit(acNdc string, acPharmacist string, anAuditQuantity float64, acYear string, acMonth string, acDay string) Audit
* Function: MakeAudit Description: Makes an audit struct @param anAuditQuantity The quantity recorded in the audit @param acPharmacist The initials of the pharmacist who performed the audit @param acDate The the audit was performed @param acNdc The ndc of the drug @return An Audit object
type Drug ¶
type Drug struct { McNdc string MrQuantity float64 McName string McDate time.Time McForm string McSize string McItemNum string }
* Drug struct contains an id name, ndc code, and quantity
type DrugDB ¶
type DrugDB struct { Name string Ndc string Size string Form string ItemNum string Month string Day string Year string Quantity float64 }
* Drug struct contains an id name, ndc code, and quantity
type Order ¶
type Order struct { AcPharmacist string AcMonth string AcDay int AcYear int AcScript, AcType string ArQty, ArActualQty float64 AcNdc string AnId int64 }
* Order struct contains the pharmacist on the order, the script/type of the order the quantity and the date of the order
func MakeOrder ¶
func MakeOrder(acNdc string, acPharmacist string, acScript string, acType string, arQty float64, arActualQty float64, acYear string, acMonth string, acDay string, anId int64) Order
* Function: MakeOrder Description: Creates an order using an audit, prescription, or purchase @param acPharmacist The pharmacist on the order @param acScript The script/type of the order @param anQty The quantity of the order @param anQty The real quantity of the order drug @param acDate The date of the order @param acType The type of the order @return An Order Object
type Prescription ¶
type Prescription struct { McNdc string McPharmacist, McScript string McYear string McMonth string McDay string MnOrderQuantity float64 MrActualQty float64 }
* Prescription struct contains the ndc of drug of the order, the pharmacist that filled the order, the script id, the quantity of the order, the date the order was filled
func MakePrescription ¶
func MakePrescription(acNdc string, asPharmacist string, acScript string, anQty float64, acYear string, acMonth string, acDay string, arActualQty float64) Prescription
* Function: MakePrescription Description: Makes a Prescription struct @param acNdc The ndc of the drug being ordered @param anQty The quantity of the order @param asPharmacist The initials of the pharmacist @param acScript The script id @param acDate The date of the order @return A prescription object
type Purchase ¶
type Purchase struct { MnNdc string McPharmacist string McInvoice string McYear string McMonth string McDay string MrQty float64 MrActualQty float64 }
* Purchase struct contains the ndc of a drug, purchase date, and purchased quantity, and the pharmacist that counted the drug
func MakePurchase ¶
func MakePurchase(acNdc string, acPharmacist string, acInvoice string, acYear string, acMonth string, acDay string, anQty float64, anActualQty float64) Purchase
* Function: MakePurchase Description: Makes a Purchase struct @param acNdc The ndc of the drug that was bought @param acDate The date the purchase was added to the supply @param anQty The quantity bought @param acPharmacist The pharmacist that counted the drug @return A Purchase object
type User ¶
* User struct contains a username and a password value
func FindUser ¶
* Function: FindUser Description: Looks for user in the database @param acName The name of the user to be found @return The user if its found, if not a blank user
func (User) GetUserName ¶
* Function: GetUserName Description: Returns the username of the user @return The name of the user