Documentation
¶
Index ¶
- func AddStory(c *fiber.Ctx, db *sql.DB) error
- func DeleteSingleStory(id string, ctx *fasthttp.RequestCtx, db *sql.DB) error
- func GetAllStories(db *sql.DB) ([]models.Story, error)
- func GetSingleStory(id string, con *fasthttp.RequestCtx, db *sql.DB) (models.Story, error)
- func UpdateStory(ctx *fiber.Ctx, db *sql.DB) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddStory ¶
POST Request. Add a new story to the database. This includes content a description and a title.
c: Fiber Context object (Pointer).
db: PostgreSQL Database.
Returning possible error.
func DeleteSingleStory ¶
DELETE Request. Remove a single story from the database.
id: The story object in question.
ctx: Fiber Context object (Pointer).
db: *sql.DB
Returning possible error.
func GetAllStories ¶
TODO: require jwt, user verification, user login and user related story objects
Get all Story objects related to the user.
db: PostgreSQL Database.
An error will be returned if issues occur. Otherwise all stories will be returned.
Return story array and possible error.
func GetSingleStory ¶
Get a single Story Object from the database.
id: The story object in question.
con: fasthttp Request Context (Pointer).
db: PostgreSQL Database.
An error will be returned if issues occur. Otherwise the relevant story will be returned.
Types ¶
This section is empty.