handlers

package
v0.0.0-...-fdbb991 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2023 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var TemplateCache = make(map[string]*template.Template)

Functions

func Auth

func Auth(w http.ResponseWriter, r *http.Request)

auth page

func Blogchad

func Blogchad(w http.ResponseWriter, r *http.Request)

blogchad wall page

func BlogchadArticle

func BlogchadArticle(w http.ResponseWriter, r *http.Request)

article page

func BlogchadWrite

func BlogchadWrite(w http.ResponseWriter, r *http.Request)

create article page

func Chad

func Chad(w http.ResponseWriter, r *http.Request)

profile page

func Chatchad

func Chatchad(w http.ResponseWriter, r *http.Request)

chatchad page

func Header(w http.ResponseWriter, r *http.Request)

func Home

func Home(w http.ResponseWriter, r *http.Request)

home page

func LoadTemplate

func LoadTemplate(filename string, data any, w http.ResponseWriter)

load template func

Types

type ArticlePageData

type ArticlePageData struct {
	Article     blogchad.Article
	Comments    []blogchad.Comment
	UserID      string
	ArticleVote int // 0 - none, -1 - downvote, 1 - upvote
}

all data needed for article page

type PageLoadData

type PageLoadData struct {
	Articles []blogchad.Article
	Username string
}

type ProfileData

type ProfileData struct {
	User     users.User
	IsUser   bool
	Articles []blogchad.Article
}

type User

type User struct {
	ID   string
	Name string
}

Jump to

Keyboard shortcuts

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