database

package
v0.0.0-...-816cd83 Latest Latest
Warning

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

Go to latest
Published: May 17, 2016 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

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) AddCommunityMembership

func (db DB) AddCommunityMembership(user_id, community_id int) (err error)

func (DB) ChangePassword

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

func (DB) ChangeUsername

func (db DB) ChangeUsername(user_id int, newUsername string) error

func (DB) CheckEmailInUse

func (db DB) CheckEmailInUse(email string) (err error)

func (DB) DeleteCommunityMembership

func (db DB) DeleteCommunityMembership(user_id, community_id int) (err error)

func (DB) DeleteOtherSessions

func (db DB) DeleteOtherSessions(user_id int, sessionid string) (loggedOut int, err error)

func (DB) GetEmail

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

func (DB) GetPage

func (db DB) GetPage(categorySlug, pageSlug string) (page common.Page, err error)

func (DB) GetPages

func (db DB) GetPages() (pages []common.Page, err error)

func (DB) GetPasswordHash

func (db DB) GetPasswordHash(email string) (hash string, err error)

func (DB) GetPostsForPage

func (db DB) GetPostsForPage(userid, pageid int) (posts []common.Post, err error)

func (DB) GetSessionUserID

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

func (DB) GetSlugs

func (db DB) GetSlugs(pageID int) (categorySlug, pageSlug string, err error)

func (DB) GetTopPages

func (db DB) GetTopPages() (pages []common.PagePostCount, err error)

func (DB) GetUserID

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

func (DB) GetUserInfo

func (db DB) GetUserInfo(sessionid string) (userInfo common.UserInfo, err error)

func (DB) GetUsername

func (db DB) GetUsername(sessionid string) (username string, err error)

func (DB) ListCategories

func (db DB) ListCategories() (categories map[string]string, err error)

func (DB) ListCommunities

func (db DB) ListCommunities(userid int) (communities []common.Community, err error)

func (DB) Logout

func (db DB) Logout(sessionid string) error

func (DB) NewPage

func (db DB) NewPage(userID int, title, slug, description, address, website string, category int) (pageID int, err error)

func (DB) NewPost

func (db DB) NewPost(userID, pageID int, post string) (err error)

func (DB) NewSession

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

func (DB) OpenSessions

func (db DB) OpenSessions(user_id int) (numSessions int, err error)

func (DB) PasswordChangeRequired

func (db DB) PasswordChangeRequired(sessionid string) (isRequired bool, err error)

func (DB) RegisterUser

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

func (DB) ResetPassword

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

func (DB) SearchPages

func (db DB) SearchPages(query string) (pages []common.Page, err error)

Jump to

Keyboard shortcuts

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