database

package
v0.0.0-...-46dcc23 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2015 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Overview

* Functions for querying the database. Each function should represent the most basic useful database operation. * * The functions in the package should only be accessed through the common package.

Index

Constants

This section is empty.

Variables

View Source
var UsernameInUse = errors.New("You have already registered with this email address.")

Errors

Functions

This section is empty.

Types

type DB

type DB struct {
	// contains filtered or unexported fields
}

func NewDB

func NewDB(constr string) (DB, error)

func (DB) AddListing

func (db DB) AddListing(userid int, title, description, price string, lon, lat float64) error

func (DB) ChangePassword

func (db DB) ChangePassword(email, newPassword string) (err error)

func (DB) GetEmail

func (db DB) GetEmail(sessionid string) (email string, err error)

func (DB) GetEmailFromSessionID

func (db DB) GetEmailFromSessionID(sessionid string) (email string, err error)

func (DB) GetSessionUserID

func (db DB) GetSessionUserID(sessionid string) (userid int, err error)

func (DB) GetUserID

func (db DB) GetUserID(email string, password string) (userid int, err error)

func (DB) Logout

func (db DB) Logout(sessionid string) error

func (DB) NewSession

func (db DB) NewSession(userid int) (sessionid string, err error)

func (DB) RegisterUser

func (db DB) RegisterUser(email string) (password string, err error)

func (DB) ResetPassword

func (db DB) ResetPassword(email string) (password string, err error)

func (DB) UpdateLocation

func (db DB) UpdateLocation(userid int, lon, lat float64) error

func (DB) UpdateSession

func (db DB) UpdateSession(sessionid string) error

Jump to

Keyboard shortcuts

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