databaseActions

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: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var EmailFailed = errors.New("Sending email failed.")
View Source
var IncorrectPassword = errors.New("Incorrect password.")
View Source
var PasswordTooShort = errors.New(fmt.Sprintf("The supplied password is too short. Minimum password length is %d characters.", minPasswordLength))

Errors

View Source
var ShortPassword = errors.New("Password too short.")
View Source
var UsernameTooLong = errors.New(fmt.Sprintf("The supplied username is too long. Maximum username length is %d characters.", maxUsernameLength))
View Source
var UsernameTooShort = errors.New(fmt.Sprintf("The supplied username is too short. Minimum username length is %d characters.", minUsernameLength))

Functions

func ChangePassword

func ChangePassword(email, oldPassword, newPassword string) (err error)

func ChangeUsername

func ChangeUsername(email string, newUsername, password string) (err error)
func CheckRegisterLink(code, email, date string) bool
func CheckResetLink(code, email, date string) bool

func CreatePage

func CreatePage(userID int, title, description, address, website string, category int) (categorySlug, pageSlug string, err error)

func CreatePost

func CreatePost(user_id int, post string, page common.Page) (err error)

func GenerateResetCode

func GenerateResetCode(email string) (hash string, date string, err error)

func GetCommunityColumns

func GetCommunityColumns(userid int) ([][]common.Community, error)

func GetEmail

func GetEmail(sessionid string) (string, error)

func GetPage

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

func GetPages

func GetPages() ([]common.Page, error)

func GetPosts

func GetPosts(userid int, page common.Page) (posts []common.Post, err error)

func GetTopPages

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

func GetUserInfo

func GetUserInfo(sessionid string) (common.UserInfo, error)

func GetUsername

func GetUsername(sessionid string) (string, error)

func ListCategories

func ListCategories() (map[string]string, error)

func Login

func Login(email, password string) (sessionid string, err error)

func Logout

func Logout(sessionid string) error

func LogoutOtherSessions

func LogoutOtherSessions(sessionid string, userid int) (loggedOut int, err error)

func OtherSessions

func OtherSessions(userid int) (num int, err error)

func PasswordChangeRequired

func PasswordChangeRequired(sessionid string) (bool, error)

func Register1

func Register1(email, baseURL string) (err error)

func Register2

func Register2(username, email, password string) (sessionid string, err error)

func ResetPassword

func ResetPassword(email, baseURL string) error

func SearchPages

func SearchPages(sessionid, query string) ([]common.Page, error)

func SetCommunityMembership

func SetCommunityMembership(userid int, community_id int, value bool) (err error)

func SetPassword

func SetPassword(email, newPassword string) (err error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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