Safe HaskellNone

IHP.ControllerSupport

Synopsis

Documentation

type Action' = IO ResponseReceived Source #

(|>) :: t1 -> (t1 -> t2) -> t2 infixl 8 Source #

getRequestBody :: (?requestContext :: RequestContext) => IO ByteString Source #

getRequestPath :: (?requestContext :: RequestContext) => ByteString Source #

Returns the request path, e.g. /Users or /CreateUser

getRequestPathAndQuery :: (?requestContext :: RequestContext) => ByteString Source #

Returns the request path and the query params, e.g. /ShowUser?userId=9bd6b37b-2e53-40a4-bb7b-fdba67d6af42

getHeader :: (?requestContext :: RequestContext) => ByteString -> Maybe ByteString Source #

Returns a header value for a given header name. Returns Nothing if not found

The header is looked up in a case insensitive way.

>>> getHeader "Content-Type"
Just "text/html"
>>> getHeader "X-My-Custom-Header"
Nothing

data RequestContext Source #

Constructors

RequestContext Request Respond [Param] [File ByteString] (Key (Session IO String String)) 

request :: (?requestContext :: RequestContext) => Request Source #

requestHeaders :: Request -> RequestHeaders #

getFiles :: (?requestContext :: RequestContext) => [File ByteString] Source #

class (Show controller, Eq controller) => Controller controller where Source #

Minimal complete definition

action

Methods

beforeAction :: (?controllerContext :: ControllerContext, ?modelContext :: ModelContext, ?requestContext :: RequestContext, ?theAction :: controller) => IO () Source #

action :: (?controllerContext :: ControllerContext, ?modelContext :: ModelContext, ?requestContext :: RequestContext, ?theAction :: controller) => controller -> IO () Source #

Instances

Instances details
Controller CodeGenController Source # 
Instance details

Defined in IHP.IDE.CodeGen.Controller

Controller LogsController Source # 
Instance details

Defined in IHP.IDE.Logs.Controller

Controller DataController Source # 
Instance details

Defined in IHP.IDE.Data.Controller

Controller EnumValuesController Source # 
Instance details

Defined in IHP.IDE.SchemaDesigner.Controller.EnumValues

Controller EnumsController Source # 
Instance details

Defined in IHP.IDE.SchemaDesigner.Controller.Enums

Controller ColumnsController Source # 
Instance details

Defined in IHP.IDE.SchemaDesigner.Controller.Columns

Controller TablesController Source # 
Instance details

Defined in IHP.IDE.SchemaDesigner.Controller.Tables

Controller SchemaController Source # 
Instance details

Defined in IHP.IDE.SchemaDesigner.Controller.Schema

Controller WelcomeController Source # 
Instance details

Defined in IHP.Welcome.Controller

runAction :: forall controller. (Controller controller, ?requestContext :: RequestContext, ?controllerContext :: ControllerContext, ?modelContext :: ModelContext, FrameworkConfig) => controller -> IO ResponseReceived Source #

fromControllerContext :: forall a. (?controllerContext :: ControllerContext, Typeable a) => a Source #

maybeFromControllerContext :: forall a. (?controllerContext :: ControllerContext, Typeable a) => Maybe a Source #

class InitControllerContext application where Source #

Minimal complete definition

Nothing

Methods

initContext :: (?modelContext :: ModelContext, ?requestContext :: RequestContext, ?applicationContext :: ApplicationContext) => TMap -> IO TMap Source #

Instances

Instances details
InitControllerContext ToolServerApplication Source # 
Instance details

Defined in IHP.IDE.ToolServer

runActionWithNewContext :: forall application controller. (Controller controller, ?applicationContext :: ApplicationContext, ?requestContext :: RequestContext, InitControllerContext application, ?application :: application, Typeable application, Typeable controller, FrameworkConfig) => controller -> IO ResponseReceived Source #

respondAndExit :: Response -> IO () Source #

newtype ActionType Source #

Constructors

ActionType TypeRep