package
0.0.0-20240727104708-c2d1215a6a24
Repository: https://github.com/google/go-safeweb.git
Documentation: pkg.go.dev

# Packages

Package defaults provides ready to use, safe, pre-configured instances of safehttp types.
No description provided by the author
Package restricted contains restricted APIs.
Package safehttptest provides utilities for testing safehttp.Handler:s and safehttp.Interceptor:s.

# Functions

ExecuteNamedTemplate creates a TemplateResponse from the provided Template and its data and calls the Write function of the ResponseWriter, passing the response.
ExecuteNamedTemplateWithFuncs creates a TemplateResponse from the provided Template, its data and the name to function mappings and calls the Write function of the ResponseWriter, passing the response.
ExecuteTemplate creates a TemplateResponse from the provided Template and its data and calls the Write function of the ResponseWriter, passing the response.
ExecuteTemplateWithFuncs creates a TemplateResponse from the provided Template, its data and the name to function mappings and calls the Write function of the ResponseWriter, passing the response.
FileServer returns a handler that serves HTTP requests with the contents of the file system rooted at root.
No description provided by the author
FlightValues returns a map associated with the given request processing flight.
IsLocalDev returns whether the framework is set up to use local development rules.
NewCookie creates a new Cookie with safe default settings.
NewHeader creates a new Header.
NewIncomingRequest creates an IncomingRequest from the underlying http.Request.
NewServeMuxConfig crates a ServeMuxConfig with the provided Dispatcher.
NotWritten returns a Result which indicates that nothing has been written yet.
ParseURL parses a raw URL string into a URL structure.
Redirect creates a RedirectResponse and writes it to w.
RegisteredHandler returns the combined (all request methods) handler registered for a given pattern.
StripPrefix returns a handler that serves HTTP requests by removing the given prefix from the request URL's Path (and RawPath if set) and invoking the handler h.
UseLocalDev instructs the framework to disable some security mechanisms that would make local development hard or impossible.
WriteJSON creates a JSONResponse from the data object and calls the Write function of the ResponseWriter, passing the response.

# Constants

RFC 7231, 4.3.6.
RFC 7231, 4.3.5.
RFC 7231, 4.3.1.
RFC 7231, 4.3.2.
RFC 7231, 4.3.7.
RFC 5789.
RFC 7231, 4.3.3.
RFC 7231, 4.3.4.
RFC 7231, 4.3.8.
SameSiteLaxMode allows sending cookies with same-site requests and cross-site top-level navigations.
SameSiteNoneMode allows sending cookies with all requests, including the ones made cross-origin.
SameSiteStrictMode allows sending cookie only with same-site requests.
RFC 7231, 6.3.3.
RFC 5842, 7.1.
RFC 7231, 6.6.3.
RFC 7231, 6.5.1.
RFC 7231, 6.5.8.
RFC 7231, 6.2.1.
RFC 7231, 6.3.2.
RFC 8297.
RFC 7231, 6.5.14.
RFC 4918, 11.4.
RFC 7231, 6.5.3.
RFC 7231, 6.4.3.
RFC 7231, 6.6.5.
RFC 7231, 6.5.9.
RFC 7231, 6.6.6.
RFC 3229, 10.4.1.
RFC 4918, 11.5.
RFC 7231, 6.6.1.
RFC 7231, 6.5.10.
RFC 4918, 11.3.
RFC 5842, 7.2.
RFC 7231, 6.5.5.
RFC 7540, 9.1.2.
RFC 7231, 6.4.2.
RFC 7231, 6.4.1.
RFC 4918, 11.1.
RFC 6585, 6.
RFC 7231, 6.3.5.
RFC 7231, 6.3.4.
RFC 7231, 6.5.6.
RFC 2774, 7.
RFC 7231, 6.5.4.
RFC 7231, 6.6.2.
RFC 7232, 4.1.
RFC 7231, 6.3.1.
RFC 7233, 4.1.
RFC 7231, 6.5.2.
RFC 7538, 3.
RFC 7232, 4.2.
RFC 6585, 3.
RFC 2518, 10.1.
RFC 7235, 3.2.
RFC 7233, 4.4.
RFC 7231, 6.5.11.
RFC 6585, 5.
RFC 7231, 6.5.7.
RFC 7231, 6.5.12.
RFC 7231, 6.3.6.
RFC 7231, 6.4.4.
RFC 7231, 6.6.4.
RFC 7231, 6.2.2.
RFC 7168, 2.3.3.
RFC 7231, 6.4.7.
RFC 8470, 5.2.
RFC 6585, 4.
RFC 7235, 3.1.
RFC 7725, 3.
RFC 4918, 11.2.
RFC 7231, 6.5.13.
RFC 7231, 6.5.15.
RFC 7231, 6.4.5.
RFC 2295, 8.1.

# Structs

A Cookie represents an HTTP cookie as sent in the Set-Cookie header of an HTTP response or the Cookie header of an HTTP request.
DefaultDispatcher is responsible for writing safe responses.
FileServerResponse represents a FileServer response.
Form contains parsed data from form parameters, part of the body of POST, PATCH or PUT requests that are not multipart requests.
Header represents the key-value pairs in an HTTP header.
IncomingRequest represents an HTTP request received by the server.
JSONResponse should encapsulate a valid JSON object that will be serialised and written to the http.ResponseWriter using a JSON encoder.
MultipartForm extends a parsed multipart form, part of the body of a PATCH, POST or PUT request.
NoContentResponse is used to write a "No Content" response.
RedirectResponse is used to generate redirect responses.
Result is the result of writing an HTTP response.
ServeMux is an HTTP request multiplexer.
ServeMuxConfig is a builder for ServeMux.
Server is a safe wrapper for a standard HTTP server.
TemplateResponse bundles a Template with its data and names to function mappings to be passed together to the commit phase.
URL represents a parsed URL (technically, a URI reference).

# Interfaces

Dispatcher is responsible for writing a response received from the ResponseWriter to the underlying http.ResponseWriter.
ErrorResponse is an HTTP error response.
Handler responds to an HTTP request.
Interceptor alter the processing of incoming requests.
InterceptorConfig is a configuration for an interceptor.
Map is a key/value map.
Response should encapsulate the data passed to the ResponseWriter to be written by the Dispatcher.
ResponseHeadersWriter is used to alter the HTTP response headers.
ResponseWriter is used to construct an HTTP response.
Template implements a template.

# Type aliases

HandlerFunc is used to convert a function into a Handler.
SameSite allows a server to define a cookie attribute making it impossible for the browser to send this cookie along with cross-site requests.
StatusCode contains HTTP status codes as registered with IANA.