src/happyx/bindings/python_types

Search:
Group by:

Types

FileResponseObj = ref object of PyNimObjectExperimental
  filename*: string
  statusCode*: int
  asAttachment*: bool
HandlerParam = object
  name*, paramType*: string
  reserved*: bool
HtmlResponseObj = ref object of PyNimObjectExperimental
  data*: string
  statusCode*: int
  headers*: PyObject
HttpRequest = ref object of PyNimObjectExperimental
  path*: string
  body*: string
  httpMethod*: string
  headers*: PPyObject
JsonResponseObj = ref object of PyNimObjectExperimental
  data*: JsonNode
  statusCode*: int
  headers*: PyObject
RequestModelData = object
  name*: string
  pyClass*: PyObject
  fields*: seq[tuple[key, val: string]]
RequestModels = ref object of PyNimObjectExperimental
  requestModels*: seq[RequestModelData]
ResponseObj = ref object of PyNimObjectExperimental
  data*: string
  statusCode*: int
  headers*: PyObject
Route = ref object of PyNimObjectExperimental
  path*: string
  purePath*: string
  httpMethod*: seq[string]
  pattern*: Regex2
  handler*: PyObject
  locals*: PyObject
  posArgs*: seq[string]
  params*: JsonNode
  handlerParams*: seq[HandlerParam]
  isAsync*: bool
WebSocket = ref object of PyNimObjectExperimental
  id*: uint64
  ws*: websocketx.WebSocket
  data*: string
  state*: WebSocketState
WebSocketState {.pure, size: 1.} = enum
  wssConnect, wssOpen, wssClose, wssHandshakeError, wssMismatchProtocol,
  wssError

Vars

requestModelsHidden = RequestModels(requestModels: @[])
uniqueWebSocketId: uint64 = 0

Procs

proc `[]`(params: seq[HandlerParam]; key: string): string {....raises: [],
    tags: [], forbids: [].}
proc `[]`(self: RequestModels; name: string): RequestModelData {....raises: [],
    tags: [], forbids: [].}
proc contains(params: seq[HandlerParam]; key: string): bool {....raises: [],
    tags: [], forbids: [].}
proc contains(self: RequestModels; name: string): bool {....raises: [], tags: [],
    forbids: [].}
proc getParamName(params: seq[HandlerParam]; paramType: string): string {.
    ...raises: [], tags: [], forbids: [].}
proc getParamType(params: seq[HandlerParam]; key: string): string {....raises: [],
    tags: [], forbids: [].}
proc hasHttpMethod(self: Route;
                   httpMethod: string | seq[string] | openArray[string]): bool
proc hasHttpRequest(params: seq[HandlerParam]): bool {....raises: [], tags: [],
    forbids: [].}
proc hasParamType(params: seq[HandlerParam]; key: string): bool {....raises: [],
    tags: [], forbids: [].}
proc initHttpRequest(path, httpMethod: string; headers: HttpHeaders;
                     body: string = ""): HttpRequest {.
    ...raises: [Exception, ValueError], tags: [RootEffect], forbids: [].}
proc initRoute(path, purePath: string; httpMethod: seq[string]; pattern: Regex2;
               handler: PyObject): Route {.
    ...raises: [Exception, ValueError, OSError, IOError, EOFError, KeyError],
    tags: [RootEffect, ReadDirEffect, ReadEnvEffect, ReadIOEffect], forbids: [].}
proc newAnnotations(data: PyObject): JsonNode {.
    ...raises: [Exception, ValueError, OSError, IOError, EOFError, KeyError],
    tags: [RootEffect], forbids: [].}
proc newHandlerParams(args: openArray[string]; annotations: JsonNode): seq[
    HandlerParam] {....raises: [KeyError], tags: [], forbids: [].}
proc newWebSocketObj(ws: websocketx.WebSocket; data: string = ""): python_types.WebSocket {.
    ...raises: [], tags: [], forbids: [].}
proc processWebSocket(py, locals: PyObject) {.
    ...raises: [Exception, ValueError, OSError, IOError, EOFError, KeyError],
    tags: [RootEffect], forbids: [].}
proc toHttpHeaders(headers: PyObject): HttpHeaders {.
    ...raises: [Exception, ValueError], tags: [RootEffect], forbids: [].}
proc toPPyObject(headers: HttpHeaders): PPyObject {.
    ...raises: [Exception, ValueError], tags: [RootEffect], forbids: [].}