UNPKG

@goa/goa

Version:

The Goa Source Code For Compilation Into @Goa/Koa That Includes Modules, Tests, Types And Dependencies.

71 lines (66 loc) 3 kB
<types namespace="_goa"> <import from="http" name="IncomingMessage" /> <import from="http" name="ServerResponse" /> <!-- The cookies are vendored in types/vendor --> <import from=".." ns="_goa" name="Cookies" /> <import from=".." ns="_goa" name="Application" /> <import from=".." ns="_goa" name="Request" /> <import from=".." ns="_goa" name="Response" /> <import from=".." ns="_goa" name="ContextDelegatedResponse" /> <import from=".." ns="_goa" name="ContextDelegatedRequest" /> <interface extends="_goa.ContextDelegatedResponse,_goa.ContextDelegatedRequest" name="Context" desc="The context object for each request."> <fn name="constructor"> The application will construct instances of _Context_ for each request manually. </fn> <prop type="!_goa.Cookies" name="cookies"> The cookies instance. </prop> <prop boolean name="respond"> To bypass Koa's built-in response handling, you may explicitly set `ctx.respond = false;` </prop> <prop type="string" name="originalUrl"> Get request original URL. </prop> <prop type="Object" name="state"> The recommended namespace for passing information through middleware and to your frontend views. </prop> <fn name="inspect" return="!Object"> `util.inspect()` implementation, which just returns the JSON output. </fn> <fn name="toJSON" return="!Object"> Return JSON representation. </fn> <fn void name="assert" example="../example/jsdoc/context/assert.js"> <arg name="value">The value the presence of which to assert on.</arg> <arg number name="status" opt>The error status code.</arg> <arg string name="message" opt>The error message.</arg> <arg type="!Object" name="opts" opt>The error properties.</arg> Similar to .throw(), adds assertion. </fn> <fn name="throw" example="../example/jsdoc/context/throw.js"> <arg number name="status" opt>The status code as number.</arg> <arg string name="message" opt>The message. By default, will look up in the status code table.</arg> <arg string name="props" opt>Additional custom properties to attach to object.</arg> Throw an error with `msg` and optional `status` defaulting to 500. Note that these are user-level errors, and the message may be exposed to the client. </fn> <fn name="onerror"> <arg type="!Error" name="error">The error.</arg> Default error handling. </fn> <prop type="!_goa.Application" name="app"> The reference to the application. </prop> <prop type="!_goa.Request" name="request"> The reference to the request instance. </prop> <prop type="!_goa.Response" name="response"> The reference to the response instance. </prop> <prop type="!http.IncomingMessage" name="req"> The message from the client. </prop> <prop type="!http.ServerResponse" name="res"> The response from the server. </prop> </interface> </types>