endpoints

package
v0.0.0-...-61485b7 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2021 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateTask

func CreateTask(w http.ResponseWriter, r *http.Request, t *TaskHandlerInput, db *sql.DB)

CreateTask function performs updation task on the task list

func DeleteTask

func DeleteTask(w http.ResponseWriter, r *http.Request, t *TaskHandlerInput, db *sql.DB)

DeleteTask function performs updation task on the task list

func GetAllTasks

func GetAllTasks(w http.ResponseWriter, r *http.Request, db *sql.DB)

GetAllTasks function gets all tasks from the task list db

func GetAllTodoTasks

func GetAllTodoTasks(w http.ResponseWriter, r *http.Request, db *sql.DB)

GetAllTodoTasks function gets all tasks from the task list db which are not completed

func GetByTitle

func GetByTitle(w http.ResponseWriter, r *http.Request, db *sql.DB, title string)

GetByTitle provides the searched task from the db with matching title

func GetByTodayTasks

func GetByTodayTasks(w http.ResponseWriter, r *http.Request, db *sql.DB)

GetByTodayTasks function gets all tasks from the task list db which are due by taday's date

func GetOverdueTasks

func GetOverdueTasks(w http.ResponseWriter, r *http.Request, db *sql.DB)

GetOverdueTasks function gets all tasks from the task list db which are overdue

func UpdateTask

func UpdateTask(w http.ResponseWriter, r *http.Request, t *TaskHandlerInput, db *sql.DB)

UpdateTask function performs updation task on the task list

func ValidateTaskEntry

func ValidateTaskEntry(t *TaskHandlerInput) (bool, map[string]string)

ValidateTaskEntry function validates the input before they are processed into the database

Types

type TaskHandlerInput

type TaskHandlerInput struct {
	TaskTitle string `json:"taskTitle" bson:"taskTitle"`
	DueDate   string `json:"dueDate" bson:"dueDate"`
	TaskDone  bool   `json:"taskDone" bson:"taskDone"`
}

TaskHandlerInput defines the input json structure for dml endpoints

Jump to

Keyboard shortcuts

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