Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Golang SDK immudb #34

Closed
mmeloni opened this issue Mar 27, 2020 · 1 comment
Closed

Golang SDK immudb #34

mmeloni opened this issue Mar 27, 2020 · 1 comment
Assignees
Labels
back-end enhancement New feature or request good first issue Good for newcomers

Comments

@mmeloni
Copy link
Contributor

mmeloni commented Mar 27, 2020

Actually immugw rest proxy exposes simplify api that wrap immudb one's.
All safe methods exposes by immugw (SafeSet, SafeGet, SafeReference, SafeZAdd) doesn't require for root and index because this data is managed internally.
The purpose of this task is to create a golang SDK to offer the same capabilities but in pure GO.
It should be fine that immugw wil be upgraded in order to use the newly sdk.
In order to do this you could use a new .proto schema that extends https://github.com/codenotary/immudb/blob/master/pkg/api/schema/schema.proto
Ex:
actual SafeGet service in immudb schema.proto

message SafeGetOptions {
	Key key = 1;
	Index rootIndex = 2;
}
rpc SafeGet(SafeGetOptions) returns (SafeItem){
		option (google.api.http) = {
            post: "/v1/immurestproxy/item/safe/get"
            body: "*"
        };
	};

New SafeSet in immu.proto

rpc SafeGet(Key) returns (VeridiedItem){};

eg: VerifiedItem contains item and a bool in which we put verification results.

Flow:

  • The sdk will intercept SafeGet,
  • will retrieve rootIndex from client.RootService package
  • will forward the call to immudb (with SafeGet(SafeGetOptions) )
  • will make checks on result
  • will return to the user the VerifiedItem
@padurean
Copy link
Contributor

padurean commented Apr 6, 2020

Merged to master.

@padurean padurean closed this as completed Apr 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
back-end enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants