db

package
v0.0.0-...-a468dfb Latest Latest
Warning

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

Go to latest
Published: May 7, 2019 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DB *gorm.DB

DB db

Functions

func CheckUserValid

func CheckUserValid(id int, email string) (bool, error)

CheckUserValid db

func Follow

func Follow(followerID, followeeID int) error

Follow db

func GetCommentByIDAndPost

func GetCommentByIDAndPost(id int, postID int) (*model.Comment, error)

GetCommentByIDAndPost db

func GetCommentsForPost

func GetCommentsForPost(id int) ([]*model.Comment, error)

GetCommentsForPost db

func GetFolloweeByIDAndUser

func GetFolloweeByIDAndUser(id int, userID int) (*model.User, error)

GetFolloweeByIDAndUser db: get the people who follow you

func GetFolloweesForUser

func GetFolloweesForUser(id int) ([]*model.User, error)

GetFolloweesForUser db

func GetFollowerByIDAndUser

func GetFollowerByIDAndUser(id int, userID int) (*model.User, error)

GetFollowerByIDAndUser db

func GetFollowersForUser

func GetFollowersForUser(id int) ([]*model.User, error)

GetFollowersForUser db: get the people who you follow

func GetPostByID

func GetPostByID(id int) (*model.Post, error)

GetPostByID db

func GetPostByIDAndUser

func GetPostByIDAndUser(id, userID int) (*model.Post, error)

GetPostByIDAndUser db

func GetPostsForUser

func GetPostsForUser(userID int) ([]*model.Post, error)

GetPostsForUser db

func GetUserByID

func GetUserByID(id int) (*model.User, error)

GetUserByID db

func Init

func Init()

Init db

func InsertComment

func InsertComment(comment *model.Comment) error

InsertComment db

func InsertPost

func InsertPost(post *model.Post) error

InsertPost db

func InsertUser

func InsertUser(user *model.User) error

InsertUser db

func Login

func Login(email string, pw string) (bool, error)

Login db

func PraisePost

func PraisePost(postID int) error

PraisePost db

func RemoveCommentByID

func RemoveCommentByID(id int) error

RemoveCommentByID db

func RemovePostByID

func RemovePostByID(id int) error

RemovePostByID db

func RemoveUserByID

func RemoveUserByID(id int) error

RemoveUserByID db

func UnPraisePost

func UnPraisePost(postID int) error

UnPraisePost db

func Unfollow

func Unfollow(followerID, followeeID int) error

Unfollow db

func UpdatePost

func UpdatePost(postID int, title, body string) error

UpdatePost db

Types

This section is empty.

Jump to

Keyboard shortcuts

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