queries

package
v0.0.0-...-5ce1543 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddStory

func AddStory(c *fiber.Ctx, db *sql.DB) error

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

func DeleteSingleStory(id string, ctx *fasthttp.RequestCtx, db *sql.DB) error

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

func GetAllStories(db *sql.DB) ([]models.Story, error)

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

func GetSingleStory(id string, con *fasthttp.RequestCtx, db *sql.DB) (models.Story, error)

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.

func UpdateStory

func UpdateStory(ctx *fiber.Ctx, db *sql.DB) error

PUT Request. Update the contents and information of a single story row.

ctx: Fiber Context object (Pointer).

db: *sql.DB

Returning possible error.

Types

This section is empty.

Jump to

Keyboard shortcuts

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