-
Notifications
You must be signed in to change notification settings - Fork 16
/
main.lisp
77 lines (71 loc) · 1.64 KB
/
main.lisp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
(defpackage #:jsonrpc
(:nicknames #:jsonrpc/main)
(:use #:cl
#:jsonrpc/request-response
#:jsonrpc/transport/interface
#:jsonrpc/base
#:jsonrpc/client
#:jsonrpc/server
#:jsonrpc/errors
#:jsonrpc/mapper)
(:export
;; from request-response
#:request
#:response
#:make-request
#:make-response
#:request-method
#:request-params
#:request-id
#:response-error
#:response-result
#:response-id
#:parse-message
;; from transports
#:transport
;; from base/server/client
#:*default-timeout*
#:*jsonrpc-version*
#:server
#:client
#:send-message
#:receive-message
#:server-listen
#:client-connect
#:client-disconnect
#:expose
#:register-method
#:clear-methods
#:dispatch
#:call-to
#:call-async-to
#:notify-to
#:call
#:call-async
#:notify
#:notify-async
#:broadcast
#:multicall-async
;; from errors
#:jsonrpc-error
#:jsonrpc-parse-error
#:jsonrpc-invalid-request
#:jsonrpc-invalid-response
#:jsonrpc-method-not-found
#:jsonrpc-invalid-params
#:jsonrpc-internal-error
#:jsonrpc-server-error
#:jsonrpc-error-code
#:jsonrpc-error-message
#:*debug-on-error*
;; from this package
#:make-server
#:make-client))
(in-package #:jsonrpc)
(declaim (ftype (function (&key (:version jsonrpc-version)))))
(defun make-client (&key (version *jsonrpc-version*))
"Creates and returns a new instance of the client class.
Optionally the jsonrpc version can be supplied. Valid values are 2.0 or 1.0"
(make-instance 'client :version version))
(defun make-server ()
(make-instance 'server))