ui

package
v0.0.0-...-a84335b Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2024 License: AGPL-3.0 Imports: 25 Imported by: 0

Documentation

Overview

Package ui defines the routes and templates for the HTML user interface.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HTMLPage

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

htmlPage is a rendered html page to be written in a response.

func (HTMLPage) Bytes

func (page HTMLPage) Bytes() []byte

Bytes returns the bytes of the html page.

func (HTMLPage) HTTPStatus

func (page HTMLPage) HTTPStatus() int

HTTPStatus returns the pages HTTP status.

type Handler

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

func New

func New(db *database.Queries, eml *email.Sender, a authSrv, p profileSrv, w wishlistSrv) *Handler

func (*Handler) Routes

func (h *Handler) Routes(router *mux.Router)

type NotFoundErr

type NotFoundErr string

func (NotFoundErr) Error

func (err NotFoundErr) Error() string

func (NotFoundErr) HTML

func (err NotFoundErr) HTML() string

func (NotFoundErr) HTTPStatus

func (err NotFoundErr) HTTPStatus() int

type PermissionsErr

type PermissionsErr string

func (PermissionsErr) Error

func (err PermissionsErr) Error() string

func (PermissionsErr) HTML

func (err PermissionsErr) HTML() string

func (PermissionsErr) HTTPStatus

func (err PermissionsErr) HTTPStatus() int

type View

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

View wraps a template argument builder and engine into a requests scoped execution.

func NewView

func NewView(tpl *template.Engine, r *http.Request) *View

NewView creates a new ui view.

func (*View) Render

func (v *View) Render(template string) HTMLPage

Render takes the current view state and applies it to the indicated template.

func (*View) Set

func (v *View) Set(param string, value interface{}) *View

Set adds the given parameter and value to the view state.

func (*View) Status

func (v *View) Status(status int)

Status sets the views intended HTTP status.

Directories

Path Synopsis
Package static handles processing and retreiving static assets.
Package static handles processing and retreiving static assets.
Package template provides a templating engine for presenting the ui.
Package template provides a templating engine for presenting the ui.

Jump to

Keyboard shortcuts

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