types

package
v0.0.0-...-90cea4e Latest Latest
Warning

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

Go to latest
Published: May 7, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Categories

type Categories []Category

Categories will show

type Category

type Category struct {
	ID      int    `json:"category_id"`
	Name    string `json:"category_name"`
	Created string `json:"created_date"`
}

Category is the structure of the category table

type CategoryCount

type CategoryCount struct {
	Name  string
	Count int
}

CategoryCount is the struct used to populate the sidebar which contains the category name and the count of the tasks in each category

type Comment

type Comment struct {
	ID       int    `json:"id"`
	Content  string `json:"content"`
	Created  string `json:"created_date"`
	Username string `json:"username"`
}

Comment is the struct used to populate comments per tasks

type Context

type Context struct {
	Tasks      []Task
	Navigation string
	Search     string
	Message    string
	CSRFToken  string
	Categories []CategoryCount
	Referer    string
}

Context is the struct passed to templates

type Status

type Status struct {
	StatusCode int    `json:"status_code"`
	Message    string `json:"message"`
}

Status is the JSON struct to be returned

type Task

type Task struct {
	Id           int           `json:"id"`
	Title        string        `json:"title"`
	Content      string        `json:"content"`
	ContentHTML  template.HTML `json:"content_html"`
	Created      string        `json:"created"`
	Priority     string        `json:"priority"`
	Category     string        `json:"category"`
	Referer      string        `json:"referer,omitempty"`
	Comments     []Comment     `json:"comments,omitempty"`
	IsOverdue    bool          `json:"isoverdue,omitempty"`
	IsHidden     int           `json:"ishidden,omitempty`
	CompletedMsg string        `json:"ishidden,omitempty"`
}

Package types is used to store the context struct which is passed while templates are executed.

Task is the struct used to identify tasks

type Tasks

type Tasks []Task

Jump to

Keyboard shortcuts

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