rest

  Source   Edit

Types

CallRequestError = object of RestError
HTTP [45]00 status code   Source   Edit
Recallable = ref object of RootObj
  headers*: HttpHeaders
  client*: RestClient
  url*: string
  json*: JsonNode
  body*: string
  retries*: int
  began*: Time
  took*: Duration
  meth*: HttpMethod
a handle on input/output of a re-issuable API call   Source   Edit
RestCall = ref object of RootObj
  client*: RestClient
  name*: string
  meth*: HttpMethod
  url*: Uri
  Source   Edit
RestClient = ref RestClientObj
  Source   Edit
RestError = object of CatchableError
base for REST errors   Source   Edit
RetriesExhausted = object of RestError
ran outta retries   Source   Edit

Procs

proc issueRequest(rec: Recallable): Response {....raises: [RestError],
    tags: [TimeEffect, RootEffect, ReadIOEffect, WriteIOEffect].}
submit a request and store some metrics   Source   Edit
proc massageHeaders(node: JsonNode): seq[KeyVal] {....raises: [KeyError], tags: [].}
  Source   Edit
proc newRestClient(): RestClient {....raises: [LibraryError, SslError, Exception,
    IOError], tags: [RootEffect, ReadDirEffect, ReadEnvEffect].}
  Source   Edit

Methods

method `$`(c: RestCall): string {.base, ...raises: [], tags: [].}
  Source   Edit
method `$`(e: ref RestError): string {.base, ...raises: [], tags: [].}
  Source   Edit
method initRestClient(self: RestClient) {.base,
    ...raises: [LibraryError, SslError, Exception, IOError],
    tags: [RootEffect, ReadDirEffect, ReadEnvEffect].}
  Source   Edit
method newRecallable(call: RestCall; url: Uri; headers: HttpHeaders;
                     body: string): Recallable {.base, ...raises: [Exception],
    tags: [RootEffect, ReadDirEffect, ReadEnvEffect].}
make a new HTTP request that we can reissue if desired   Source   Edit