routes

package
v0.0.0-...-53b3255 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2023 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateComment

func CreateComment(c *fiber.Ctx) error

CreateComment inserts a new comment into the database for a specific post

func CreatePost

func CreatePost(c *fiber.Ctx) error

CreatePost inserts a new post into the database

func CreateUser

func CreateUser(c *fiber.Ctx) error

CreateUser inserts a new user into the database

func DeleteComment

func DeleteComment(c *fiber.Ctx) error

DeleteComment deletes a comment from the database by username and post number

func DeletePost

func DeletePost(c *fiber.Ctx) error

DeletePost deletes a post from the database by username and post number

func DeleteUser

func DeleteUser(c *fiber.Ctx) error

DeleteUser deletes a user from the database by username

func GetComment

func GetComment(c *fiber.Ctx) error

GetComment retrieves a comment from the database for a specific post by username and post number

func GetCommentByUsername

func GetCommentByUsername(username string, postNumber int) (*models.Comment, error)

func GetPost

func GetPost(c *fiber.Ctx) error

GetPost retrieves a post from the database by username and post number

func GetPostByUsername

func GetPostByUsername(username string, postNumber int) (*models.Post, error)

GetPostbyUsername retrieves a post by username and postNumber, first checking Redis cache, then the database

func GetUser

func GetUser(c *fiber.Ctx) error

GetUser retrieves a user from the database by username

func GetUserByUsername

func GetUserByUsername(username string) (*models.User, error)

GetUserByUsername retrieves a user by username, first checking Redis cache, then the database

func GetUserFriends

func GetUserFriends(username string) ([]string, error)

func GetUserPosts

func GetUserPosts(ctx context.Context, username string) ([]models.Post, error)

func LikeComment

func LikeComment(c *fiber.Ctx) error

func LikePost

func LikePost(c *fiber.Ctx) error

func LikeReport

func LikeReport(c *fiber.Ctx) error

LikeReport retrieves a report on likes given or received by a user

func ListAllPosts

func ListAllPosts(c *fiber.Ctx) error

ListPosts retrieves all posts from the database

func ListComments

func ListComments(c *fiber.Ctx) error

ListComments retrieves all comments for a post by username and post number

func ListUserPosts

func ListUserPosts(c *fiber.Ctx) error

ListUserPosts retrieves all posts of a single user from the database by username

func ListUsers

func ListUsers(c *fiber.Ctx) error

ListUsers retrieves all users from the database

func PostReport

func PostReport(c *fiber.Ctx) error

PostReport retrieves a report of all posts created by a given user

func UpdateComment

func UpdateComment(c *fiber.Ctx) error

UpdateComment updates a comment in the database by username and post number

func UpdatePost

func UpdatePost(c *fiber.Ctx) error

UpdatePost updates a post in the database by username and post number

func UpdateUser

func UpdateUser(c *fiber.Ctx) error

UpdateUser updates a user in the database and Redis cache by username

func UserCommentReport

func UserCommentReport(c *fiber.Ctx) error

UserCommentReport retrieves a report of comments created by user

Types

This section is empty.

Jump to

Keyboard shortcuts

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