ihp-1.4.0: Haskell Web Framework
Copyright(c) digitally induced GmbH 2020
Safe HaskellNone
LanguageGHC2021

IHP.Controller.Context

Description

Re-exports from ihp-context and adds IHP-specific HasField instances for accessing the WAI Request and FrameworkConfig.

Synopsis

Documentation

data ControllerContext #

Constructors

ControllerContext 

Fields

FrozenControllerContext 

Fields

Instances

Instances details
HasField "frameworkConfig" ControllerContext FrameworkConfig Source #

Access frameworkConfig via the request vault

Instance details

Defined in IHP.Controller.Context

HasField "logger" ControllerContext Logger Source # 
Instance details

Defined in IHP.Controller.Context

Methods

getField :: ControllerContext -> Logger #

HasField "request" ControllerContext Request Source #

Access request from the TMap

This allows controllerContext.request to work by retrieving the WAI Request stored in the TMap.

Instance details

Defined in IHP.Controller.Context

newControllerContext :: (?request :: Request) => IO ControllerContext Source #

Creates a new controller context with the WAI Request stored in the TMap

This version stores the Request in the TMap so it can be retrieved via the HasField instance.

putContext :: (?context :: ControllerContext, Typeable value) => value -> IO () #

fromContext :: (?context :: ControllerContext, Typeable value) => IO value #

maybeFromContext :: (?context :: ControllerContext, Typeable value) => IO (Maybe value) #

fromFrozenContext :: (?context :: ControllerContext, Typeable value) => value #

maybeFromFrozenContext :: (?context :: ControllerContext, Typeable value) => Maybe value #

newtype ActionType Source #

Used to track the current action type

Constructors

ActionType TypeRep 

Instances

Instances details
HasField "actionType" Request ActionType Source # 
Instance details

Defined in IHP.ActionType

Orphan instances

HasField "frameworkConfig" ControllerContext FrameworkConfig Source #

Access frameworkConfig via the request vault

Instance details

HasField "logger" ControllerContext Logger Source # 
Instance details

Methods

getField :: ControllerContext -> Logger #

HasField "request" ControllerContext Request Source #

Access request from the TMap

This allows controllerContext.request to work by retrieving the WAI Request stored in the TMap.

Instance details