Common Lisp Package: JSON-RPC

README:

FUNCTION

Public

EXPORT-AS-JSON-RPC (FUNC FUNCTION-NAME &OPTIONAL TYPE)

Registers a lambda function FUNC as a json-rpc function. TYPE determines how the return value of FUNC should be interpreted: :explicit using the explicit encoder syntax, :guessing using the guessing encode syntax :streaming as a raw JSON string.

INVOKE-RPC (JSON-SOURCE)

A remote method is invoked by sending a request to a remote service. The request is a single object serialized using JSON. It has three properties: * method - A String containing the name of the method to be invoked. * params - An Array of objects to pass as arguments to the method. * id - The request id. This can be of any type. It is used to match the response with the request that it is replying to.

Undocumented

CLEAR-EXPORTED

INVOKE-RPC-PARSED (METHOD PARAMS &OPTIONAL ID)

SEND-ERROR (ERRMSG CODE &OPTIONAL CONDITION)

SEND-ERROR-OBJECT (EXPLICIT-ERROBJECT &OPTIONAL CONDITION)

SEND-INTERNAL-ERROR (&OPTIONAL CONDITION)

SEND-NOTHING (&OPTIONAL CONDITION)

Private

MAKE-JSON-RPC-ERROR-OBJECT-1.1 (MESSAGE &KEY CODE ERROR-OBJECT)

This code is based on the Working Draft 7 August 2006 of Json-rpc 1.1 specification. http://json-rpc.org/wd/JSON-RPC-1-1-WD-20060807.html

MAKE-RPC-RESPONSE (&KEY RESULT ERROR ID)

When the method invocation completes, the service must reply with a response. The response is a single object serialized using JSON. It has three properties: * result - The Object that was returned by the invoked method. This must be null in case there was an error invoking the method. * error - An Error object(unspecified in json-rpc 1.0) if there was an error invoking the method. Null if there was no error. * id - This must be the same id as the request it is responding to.

Undocumented

MAKE-JSON-RPC-ERROR-OBJECT-2.0 (&KEY MESSAGE CODE DATA ERROR-OBJECT)

MACRO

Public

DEF-JSON-RPC-ENCODING (KEYWORD (VAR) &REST BODY)

Define a new encoding keyword, KEYWORD. When the encoding is invoked, the raw value will be bound to VAR, and the BODY should return the encoded value.

DEFUN-JSON-RPC (NAME TYPE LAMBDA-LIST &BODY BODY)

Defines a function and registers it as a json-rpc target.

Private

Undocumented

DEF-RESTART (RESTART-NAME &REST (PARAMS))

DEFCONSTANT (NAME VALUE &OPTIONAL DOC)

GENERIC-FUNCTION

Private

ENCODE-JSON-RPC-VALUE (RAW-VALUE ENCODING)

Translate RAW-VALUE according to JSON-RPC value encoding ENCODING

JSON-RPC-ENCODING-P (KEYWORD)

Is KEYWORD a valid JSON-RPC value encoding?

Undocumented

ENCAPSULATED-ERROR (CONDITION)

VARIABLE

Public

*JSON-RPC-VERSION*

Bind this variable to influence whether you want to use JSON-RPC version 1.1 or 2.0.

Private

Undocumented

*JSON-RPC-FUNCTIONS*

CONDITION

Public

Undocumented

JSON-RPC-CALL-ERROR

CONSTANT

Public

Undocumented

+JSON-RPC-1.1+

+JSON-RPC-2.0+

Private

Undocumented

+EMPTY-ARRAY+