-
Notifications
You must be signed in to change notification settings - Fork 232
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
Add HTTP API for datatypes. #732
Conversation
Ctx#ctx{client=Client, | ||
bucket=path_segment_to_bin(bucket, RD), | ||
key=path_segment_to_bin(key, RD), | ||
crdt_type=proplists:get_value(crdt, wrq:path_info(RD)), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought this came from the bucket_type now (that the path segment was just the string "datatypes")? Should this still be in the code?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right, I missed this.
* Remove extraction of undefined path segment into the resource context. * Guard the timeout parameter check to make sure it is greater than 0. * Add explanatory comment about the redirection when using the default bucket-type.
{Result, RD, Ctx}; | ||
TimeoutStr when is_list(TimeoutStr) -> | ||
try list_to_integer(TimeoutStr) of | ||
Timeout when is_integer(Timeout), Timeout > 0 -> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you figure out if > 0
is correct? I wonder if >= 0
is better, as you say, then 0
can mean infinity
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think in the other APIs, yes 0
means infinity
, but this doesn't coerce it. Fixing.
Ran eunit tests and tested by hand using riak-erlang-http-client#28. |
Add HTTP API for datatypes.
This rewrites
riak_kv_wm_crdt
and ensures that the functionality it exposes is similar to PB. The JSON format of request/response payloads is described in detail at the top of the module, and implemented inriak_kv_crdt_json
.