Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #7 from talko/fixes/dialyzer

Fix cond_delete/3 and dialyzer issues
  • Loading branch information...
commit beab1f2d6c8a06484a49011f3d32f368bbf48953 2 parents a3f95aa + 4ac364a
@wagerlabs wagerlabs authored
Showing with 8 additions and 5 deletions.
  1. +1 −1  src/ddb.erl
  2. +7 −4 src/ddb_iam.erl
View
2  src/ddb.erl
@@ -262,7 +262,7 @@ delete(Name, Keys, Returns)
-spec cond_delete(tablename(), key_json(), update_cond()) -> json_reply().
cond_delete(Name, Keys, Condition) ->
- cond_update(Name, Keys, Condition, 'none').
+ cond_delete(Name, Keys, Condition, 'none').
-spec cond_delete(tablename(), key_json(), update_cond(), returns()) -> json_reply().
View
11 src/ddb_iam.erl
@@ -26,6 +26,7 @@
-export([credentials/2, token/1]).
-include_lib("ibrowse/include/ibrowse.hrl").
+-include_lib("xmerl/include/xmerl.hrl").
-define(IAM_ENDPOINT, "https://sts.amazonaws.com/").
-define(IAM_AWS_VERSION, "2011-06-15").
@@ -46,14 +47,15 @@ credentials(AccessKeyId, SecretAccessKey) ->
'ok' = application:set_env('iam', 'accesskeyid', AccessKeyId),
'ok' = application:set_env('iam', 'secretaccesskey', SecretAccessKey).
--spec credentials() -> {string(), string()}.
+-spec credentials() -> {'ok', string(), string()}.
credentials() ->
{'ok', AccessKeyId} = application:get_env('iam', 'accesskeyid'),
{'ok', SecretAccessKey} = application:get_env('iam', 'secretaccesskey'),
{'ok', AccessKeyId, SecretAccessKey}.
--spec token(pos_integer()) -> {'ok', string(), string(), string()} |
+-spec token(pos_integer()) -> {'ok', string(), string(), string()} |
+ {'error', 'maximum_retries_reached'} |
{'error', string(), string()}.
token(Duration)
@@ -75,8 +77,9 @@ token(Duration)
{'error', Code, Message}
end.
--spec request(string(), string(), non_neg_integer()) -> {'ok', string()} |
- {'error', string()}.
+-spec request(string(), string(), non_neg_integer()) -> {'ok', #xmlElement{}} |
+ {'error', 'maximum_retries_reached'} |
+ {'error', #xmlElement{}}.
request(Action, Endpoint, Duration) ->
{'ok', AccessKeyId, SecretAccessKey} = credentials(),
Please sign in to comment.
Something went wrong with that request. Please try again.