html

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: 4 Imported by: 0

Documentation

Overview

Package html provides a high level builder interface for html responses

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Error

func Error(w http.ResponseWriter, r *http.Request, err error)

Error will write the error to the client with a json content type.

func Redirect

func Redirect(w http.ResponseWriter, r *http.Request, location string)

Redirect produces a redirect response to the given ResponseWriter

func Response

func Response(w http.ResponseWriter, r *http.Request, body any)

Response accepts a response object and formats an html response based on the body inputs.

Types

type ErrorResponse

type ErrorResponse interface {
	HTML() []byte
}

ErrorResponse is an error that contains an HTML representation.

Jump to

Keyboard shortcuts

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