webwire-0.1.0: Functional reactive web framework

MaintainerErtugrul Soeylemez <es@ertes.de>

WebWire.Types

Contents

Description

Types used in webwire.

Synopsis

Common types

data WebException Source

A web exception is an HTTP status code possibly with additional data.

Constructors

WebException Status

Generic web exception. This can be an internal server error (5xx) or document error (4xx), which don't need additional data.

WebRedirect Status Text

Redirection exception. The second argument specifies the URI to redirect to.

data WebOutput Source

Various output types. The boolean argument taken by the constructors specifies whether a Content-length header should be sent. If true, the string will be fully built, before being sent to the client.

Constructors

GenOutput Bool Ascii Builder

Generic data output

HtmlOutput Bool Html

UTF-8-encoded HTML.

TextOutput Bool Builder

UTF-8-encoded string.

type WebWire site = Wire (StateT (WebConfig site) IO)Source

Web request handling wires.

Utility types

data RedirectType Source

Types of redirection. For temporary redirections, especially in response to handling a form, you will want to use RedirectSeeOther.

Constructors

RedirectPermanent

Permanently moved (301).

RedirectSeeOther

See other (303).

RedirectTemporary

Temporary redirection (307).

Simple sites

type SimpleWire = WebWire ()Source

Wire type for simple sites.

Internal

data WebConfig site Source

Runtime configuration of a wire.

Constructors

WebConfig 

Fields

wcCookies :: Map ByteString ByteString

Received cookies.

wcCurrentPath :: [Text]

Current path.

wcPostParams :: Map ByteString ByteString

POST parameters.

wcPostFiles :: Map ByteString (FileInfo FilePath)

POST files.

wcQueryParams :: Map ByteString ByteString

Query parameters.

wcRequest :: Request

Current request.

wcRequestPath :: [Text]

Request path.

wcRootPath :: [Text]

Site's root path.

wcSetCookies :: Map ByteString ByteString

Cookies to add to the response.

wcSetHeaders :: [(CI Ascii, Ascii)]

Headers to add to the response.

wcSite :: site

User site argument.

wcWidget :: Widget

Default rendering widget.