Liking cljdoc? Tell your friends :D

Data Model

HL Request Handler

Handler<HLEvent, HLContext> => HLResponse 

Basic handler

(defn BasicHandler
  [{:keys [event ctx]}]
  {:statusCode 200
   :headers {"content-type" "application/json"}
   :body {:hello "world"})

Runtime/Backend initialization

(h/entrypoint [#'BasicHandler] opts)

HLContext

Map of

KeywordValue TypeDescription
:getRemainingTimeInMs(fn [] remaining-time)Gets remaining time of Lambda execution
:fnNamestringName of the function
:fnVersionstringFunction version
:fnInvokedArnstringARN of the function
:memoryLimitInMbstringLimit of the function memory
:awsRequestIdstringId of the request (useful as a correlation id
:logGroupNamestringLog group name
:logStreamNamestringLog stream name
:identityOption<CognitoIdentity>Information about the Amazon Cognito identity that authorized the request
:clientContextClientContext(mobile apps) Client context that's provided to Lambda by the client application

CognitoIdentity

Map of

KeywordValue TypeDescription
:cognitoIdentityIdstringThe authenticated Amazon Cognito identity
:cognitoIdentityPoolIdstringThe Amazon Cognito identity pool that authorized the invocation

ClientContext

Map of

KeywordValue TypeDescription
:installation_idstringApplication installation ID
:app_titlestringApp title
:app_version_namestringApp version name
:app_version_codestringApp version code
:app_package_namestringApp package name
:env.platformstringPlatfom
:env.platform_versionstringPlatform version
:env.makestring?
:env.modelstring?
:env.localestring?
:CustomstringCustom properties that can be set by the application

HLEvent

Depends on the event provider. Every service integrated with AWS Lambda may produce different shape of the event.

HLResponse

  1. nil (indicates the ACK in SQS) OR

  2. Map

    Map of

    KeywordValue Type
    :statusCodeint
    :headersClojureMap<string,string>
    :multiValueHeadersClojureMap<string,vector<string>
    :bodystring\|nil\|boolean\|vector<any>\|list<any>
    :isBase64Encodedboolean

OR

  1. ByteArray OR

    Stringified Map (2) converted to ByteArray.

  2. Future<Map|String|ByteArray|nil> OR

    Composite type of Future + primitive.

  3. ClojurePromise<Map|String|ByteArray|nil> OR

    Composite type of ClojurePromise + primitive.

  4. Channel<Map|String|ByteArray|nil (only with async-retriever)

    Composite type of Channel + primitive.

Can you improve this documentation?Edit on GitHub

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close