Skip to content

Commit 525334d

Browse files
author
Farhan
authored
(feat) multidatabase handler support (#25)
* chore(gw): add multi db client selector
1 parent f8053fc commit 525334d

31 files changed

+7407
-178
lines changed

.dockerignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,6 @@ vendor
1414
build
1515
resources
1616
/immudata
17+
18+
# client states
19+
state-*

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,5 @@ token
4040
token_admin
4141
tools/mtls
4242

43+
# client states
44+
state-*

README.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ curl --location --request POST '127.0.0.1:3323/login' \
208208
```
209209
#### Verified Set
210210
```shell script
211-
curl --location --request POST '127.0.0.1:3323/db/verified/set' \
211+
curl --location --request POST '127.0.0.1:3323/db/{database_name}/verified/set' \
212212
--header 'Content-Type: application/json' \
213213
--header 'Authorization: {{token}}' \
214214
--data-raw '{
@@ -224,7 +224,7 @@ curl --location --request POST '127.0.0.1:3323/db/verified/set' \
224224
```
225225
#### Verified Get
226226
```shell script
227-
curl --location --request POST '127.0.0.1:3323/db/verified/get' \
227+
curl --location --request POST '127.0.0.1:3323/db/{database_name}/verified/get' \
228228
--header 'Content-Type: application/json' \
229229
--header 'Authorization: {{token}}' \
230230
--data-raw '{
@@ -235,7 +235,7 @@ curl --location --request POST '127.0.0.1:3323/db/verified/get' \
235235
```
236236
#### Verified Reference
237237
```shell script
238-
curl --location --request POST '127.0.0.1:3323/db/verified/setreference' \
238+
curl --location --request POST '127.0.0.1:3323/db/{database_name}/verified/setreference' \
239239
--header 'Content-Type: application/json' \
240240
--header 'Authorization: {{token}}' \
241241
--data-raw '{
@@ -248,7 +248,7 @@ curl --location --request POST '127.0.0.1:3323/db/verified/setreference' \
248248
```
249249
#### Verified ZAdd
250250
```shell script
251-
curl --location --request POST '127.0.0.1:3323/db/verified/zadd' \
251+
curl --location --request POST '127.0.0.1:3323/db/{database_name}/verified/zadd' \
252252
--header 'Content-Type: application/json' \
253253
--header 'Authorization: {{token}}' \
254254
--data-raw '{
@@ -262,7 +262,7 @@ curl --location --request POST '127.0.0.1:3323/db/verified/zadd' \
262262
```
263263
#### ZScan
264264
```shell script
265-
curl --location --request POST '127.0.0.1:3323/db/zscan' \
265+
curl --location --request POST '127.0.0.1:3323/db/{database_name}/zscan' \
266266
--header 'Content-Type: application/json' \
267267
--header 'Authorization: {{token}}' \
268268
--data-raw '{
@@ -271,7 +271,7 @@ curl --location --request POST '127.0.0.1:3323/db/zscan' \
271271
```
272272
#### History
273273
```shell script
274-
curl --location --request POST '127.0.0.1:3323/db/history' \
274+
curl --location --request POST '127.0.0.1:3323/db/{database_name}/history' \
275275
--header 'Authorization: {{token}}' \
276276
--header 'Content-Type: application/json' \
277277
--data-raw '{
@@ -280,13 +280,13 @@ curl --location --request POST '127.0.0.1:3323/db/history' \
280280
```
281281
#### Verified Transaction
282282
```shell script
283-
curl --location --request GET '127.0.0.1:3323/db/verified/tx/1' \
283+
curl --location --request GET '127.0.0.1:3323/db/{database_name}/verified/tx/1' \
284284
--header 'Content-Type: application/json' \
285285
--header 'Authorization: {{token}}'
286286
```
287287
#### SQL Exec
288288
```shell script
289-
curl --location --request POST '127.0.0.1:3323/db/sqlexec' \
289+
curl --location --request POST '127.0.0.1:3323/db/{database_name}/sqlexec' \
290290
--header 'Authorization: {{token}}' \
291291
--header 'Content-Type: application/json' \
292292
--data-raw '{
@@ -296,7 +296,7 @@ curl --location --request POST '127.0.0.1:3323/db/sqlexec' \
296296
297297
#### SQL Exec insert
298298
```shell script
299-
curl --location --request POST '127.0.0.1:3323/db/sqlexec' \
299+
curl --location --request POST '127.0.0.1:3323/db/{database_name}/sqlexec' \
300300
--header 'Authorization: v2.public.eyJkYXRhYmFzZSI6IjUiLCJleHAiOiIyMDIxLTEwLTI4VDE4OjU1OjAyKzAyOjAwIiwic3ViIjoiaW1tdWRiIn3-aNUXqydajYFR9Aa7-q40JepLuA0tsPXeR1nRo75jA1H45RZZU9Twt6EVi-4bS4gpzeQcRNEdJs8U5oM5urcM.aW1tdWRi' \
301301
--header 'Content-Type: application/json' \
302302
--data-raw '{
@@ -306,7 +306,7 @@ curl --location --request POST '127.0.0.1:3323/db/sqlexec' \
306306
> byte arrays need to be hex encoded
307307
#### SQL Query
308308
```shell script
309-
curl --location --request POST '127.0.0.1:3323/db/sqlquery' \
309+
curl --location --request POST '127.0.0.1:3323/db/{database_name}/sqlquery' \
310310
--header 'Authorization: {{token}}' \
311311
--header 'Content-Type: application/json' \
312312
--data-raw '{
@@ -317,7 +317,7 @@ curl --location --request POST '127.0.0.1:3323/db/sqlquery' \
317317
#### SQL Verified sql row
318318
Its possible also to tamperproof verify a SQL row.
319319
```shell script
320-
curl --location --request POST '127.0.0.1:3323/db/verified/row' \
320+
curl --location --request POST '127.0.0.1:3323/db/{database_name}/verified/row' \
321321
--header 'Authorization: v2.public.eyJkYXRhYmFzZSI6IjUiLCJleHAiOiIyMDIxLTEwLTI4VDE4OjU1OjAyKzAyOjAwIiwic3ViIjoiaW1tdWRiIn3-aNUXqydajYFR9Aa7-q40JepLuA0tsPXeR1nRo75jA1H45RZZU9Twt6EVi-4bS4gpzeQcRNEdJs8U5oM5urcM.aW1tdWRi' \
322322
--header 'Content-Type: application/json' \
323323
--data-raw '{

go.mod

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ module github.com/codenotary/immugw
33
go 1.13
44

55
require (
6-
github.com/codenotary/immudb v1.4.0
6+
github.com/codenotary/immudb v1.4.1
7+
github.com/golang/protobuf v1.5.2
78
github.com/grpc-ecosystem/grpc-gateway v1.16.0
89
github.com/prometheus/client_golang v1.12.2
910
github.com/rs/cors v1.7.0

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,8 @@ github.com/cockroachdb/apd v1.1.0 h1:3LFP3629v+1aKXU5Q37mxmRxX/pIu1nijXydLShEq5I
121121
github.com/cockroachdb/apd v1.1.0/go.mod h1:8Sl8LxpKi29FqWXR16WEFZRNSz3SoPzUzeMeY4+DwBQ=
122122
github.com/codenotary/daemon v0.0.0-20200507161650-3d4bcb5230f4 h1:5mhTmqO2f6QXPlIAGCEtCYR2MHNDLVkwaGWiSbffeQU=
123123
github.com/codenotary/daemon v0.0.0-20200507161650-3d4bcb5230f4/go.mod h1:PFDPquCi+3LI5PpAKS/8LvJBHTfkdsEXfGtANGx9hH4=
124-
github.com/codenotary/immudb v1.4.0 h1:VDcqwhCVBNl4LJ8wPYo5FjrbdwRyE7PN7Cp0Rm+/vA0=
125-
github.com/codenotary/immudb v1.4.0/go.mod h1:TBSnyZYdbWf8xaJ3N2YWkpXWyAxtHvpxsjlHvrvXt6Y=
124+
github.com/codenotary/immudb v1.4.1 h1:ChMYZULvUQ1JPpzAj84ZkhkpC8Zv/70x6NwRI/dYn+M=
125+
github.com/codenotary/immudb v1.4.1/go.mod h1:TBSnyZYdbWf8xaJ3N2YWkpXWyAxtHvpxsjlHvrvXt6Y=
126126
github.com/containerd/console v1.0.3/go.mod h1:7LqA/THxQ86k76b8c/EMSiaJ3h1eZkMkXar0TQ1gf3U=
127127
github.com/containerd/continuity v0.3.0/go.mod h1:wJEAIwKOm/pBZuBd0JmeTvnLquTB1Ag8espWhkykbPM=
128128
github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk=

0 commit comments

Comments
 (0)