models

package
v0.0.0-...-8bb3452 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2018 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package models holds all the data layer interfaces and transactions

Index

Constants

This section is empty.

Variables

View Source
var Db *sql.DB

Db is global variable pointer to database connection

Functions

func ConnToDB

func ConnToDB(dbURL string)

ConnToDB connects the database. This should be called at the app start

func CreateMember

func CreateMember(m *NewMember) error

CreateMember creates the new member record

func GetMemberID

func GetMemberID(email string) (memberID string)

GetMemberID uses the primary email of a user to get the memberID from the member's table

func GetMemberName

func GetMemberName(id string) (name string)

GetMemberName grabs the name using the email

func UpdateMemberEmail

func UpdateMemberEmail(id string, email string) bool

UpdateMemberEmail uses the member ID to insert a new email

func UpdateMemberName

func UpdateMemberName(id string, name string) bool

UpdateMemberName uses the member ID to insert a new name

Types

type NewMember

type NewMember struct {
	Name, Email, Email2, Password, Password2 string
}

NewMember is the struct for the member signup process

Jump to

Keyboard shortcuts

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