controllers

package
v0.0.0-...-7f65031 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2021 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ContentNotFoundErr       = services.NewContentFake("404 Not Found", "Return to <a href='/'>homepage</a>.")
	ContentInternalServerErr = services.NewContentFake("500 Internal Server Error", "Return to <a href='/'>homepage</a>.")
)

Functions

This section is empty.

Types

type ContentController

type ContentController struct {
	Controller
	// contains filtered or unexported fields
}

func NewContentController

func NewContentController(c Controller, defaultSlug string, pageCategory, postCategory uint) (ContentController, error)

func (ContentController) ServeHTTP

func (cc ContentController) ServeHTTP(rw http.ResponseWriter, r *http.Request)

type Controller

type Controller struct {
	// contains filtered or unexported fields
}

func NewController

func NewController(logger *log.Logger, data services.DataService, v views.View) Controller

func (Controller) Context

func (Controller) Err

func (c Controller) Err(rw http.ResponseWriter, r *http.Request, sc int, err error)

func (*Controller) HTML

func (c *Controller) HTML(rw http.ResponseWriter, r *http.Request, tmpl *template.Template, data interface{})

func (Controller) ServeHTTP

func (c Controller) ServeHTTP(rw http.ResponseWriter, r *http.Request)

type ListController

type ListController struct {
	Controller
	// contains filtered or unexported fields
}

func NewListController

func NewListController(c Controller, parentCategory uint, ns string) (ListController, error)

func (ListController) ServeHTTP

func (lc ListController) ServeHTTP(rw http.ResponseWriter, r *http.Request)

type SearchController

type SearchController struct {
	Controller
	// contains filtered or unexported fields
}

func NewSearchController

func NewSearchController(c Controller, pageCategory, postCategory uint) (SearchController, error)

func (SearchController) ServeHTTP

func (c SearchController) ServeHTTP(rw http.ResponseWriter, r *http.Request)

Jump to

Keyboard shortcuts

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