helpers

package
v10.0.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2020 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckIfFollowed

func CheckIfFollowed(who string, whom string) bool

func CheckPasswordHash

func CheckPasswordHash(password, hash string) bool

func CheckUsernameExists

func CheckUsernameExists(username string) bool

func GetConnString

func GetConnString() string

func GetCurrentTime

func GetCurrentTime() string

func GetDB

func GetDB() *gorm.DB

func GetGravatarHash

func GetGravatarHash(g_email string) string

func GetImageFromID

func GetImageFromID(id int) string

func GetUserID

func GetUserID(username string) int

func GetUserName

func GetUserName(request *http.Request) (userName string)

func GetUsernameFromID

func GetUsernameFromID(id int) string

func HashPassword

func HashPassword(password string) string

func InitDB

func InitDB() *gorm.DB

func IsEmpty

func IsEmpty(data string) bool

func PostsAmount

func PostsAmount(posts []Post) bool

func UserIsValid

func UserIsValid(uName, pwd string) bool

func ValidUser

func ValidUser(username string, psw string) bool

Types

type Post

type Post struct {
	Username   string
	Message_id int
	Author_id  int
	Text       string
	Pub_date   string
	Flagged    int
	Image_url  string
}

func GetMoreposts

func GetMoreposts(numberOfPosts int) []Post

func GetUserPosts

func GetUserPosts(username string) []Post

Jump to

Keyboard shortcuts

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