responses

package
v0.0.0-...-e9e466a Latest Latest
Warning

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

Go to latest
Published: May 19, 2021 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Error

type Error struct {
	StatusCode safehttp.StatusCode
	Message    safehtml.HTML
}

Error is a safe error response (as recognized by the secure.dispatcher).

This showcases implementing custom safe responses. See https://pkg.go.dev/github.com/google/safehtml/template#hdr-Threat_model.

func NewError

func NewError(code safehttp.StatusCode, message safehtml.HTML) Error

NewError creates a new error response.

func (Error) Code

func (e Error) Code() safehttp.StatusCode

Code returns the HTTP response code.

Jump to

Keyboard shortcuts

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