Constrain keys
Rather than supporting any() - constrain at least to binary()/integer() or string().
This commit is contained in:
parent
50967438d3
commit
bde188e691
3 changed files with 7 additions and 11 deletions
|
@ -162,6 +162,7 @@
|
||||||
-type head_timings() :: no_timing|#head_timings{}.
|
-type head_timings() :: no_timing|#head_timings{}.
|
||||||
-type timing_types() :: head|get|put|fold.
|
-type timing_types() :: head|get|put|fold.
|
||||||
-type recent_aae() :: false|#recent_aae{}|undefined.
|
-type recent_aae() :: false|#recent_aae{}|undefined.
|
||||||
|
-type key() :: binary()|integer()|string().
|
||||||
-type open_options() ::
|
-type open_options() ::
|
||||||
%% For full description of options see ../docs/STARTUP_OPTIONS.md
|
%% For full description of options see ../docs/STARTUP_OPTIONS.md
|
||||||
[{root_path, string()|undefined} |
|
[{root_path, string()|undefined} |
|
||||||
|
@ -329,7 +330,7 @@ book_start(Opts) ->
|
||||||
gen_server:start_link(?MODULE, [set_defaults(Opts)], []).
|
gen_server:start_link(?MODULE, [set_defaults(Opts)], []).
|
||||||
|
|
||||||
|
|
||||||
-spec book_tempput(pid(), any(), any(), any(),
|
-spec book_tempput(pid(), key(), key(), any(),
|
||||||
leveled_codec:index_specs(),
|
leveled_codec:index_specs(),
|
||||||
leveled_codec:tag(), integer()) -> ok|pause.
|
leveled_codec:tag(), integer()) -> ok|pause.
|
||||||
|
|
||||||
|
@ -396,7 +397,7 @@ book_put(Pid, Bucket, Key, Object, IndexSpecs) ->
|
||||||
book_put(Pid, Bucket, Key, Object, IndexSpecs, Tag) ->
|
book_put(Pid, Bucket, Key, Object, IndexSpecs, Tag) ->
|
||||||
book_put(Pid, Bucket, Key, Object, IndexSpecs, Tag, infinity).
|
book_put(Pid, Bucket, Key, Object, IndexSpecs, Tag, infinity).
|
||||||
|
|
||||||
-spec book_put(pid(), any(), any(), any(),
|
-spec book_put(pid(), key(), key(), any(),
|
||||||
leveled_codec:index_specs(),
|
leveled_codec:index_specs(),
|
||||||
leveled_codec:tag(), infinity|integer()) -> ok|pause.
|
leveled_codec:tag(), infinity|integer()) -> ok|pause.
|
||||||
|
|
||||||
|
@ -432,7 +433,7 @@ book_mput(Pid, ObjectSpecs) ->
|
||||||
book_mput(Pid, ObjectSpecs, TTL) ->
|
book_mput(Pid, ObjectSpecs, TTL) ->
|
||||||
gen_server:call(Pid, {mput, ObjectSpecs, TTL}, infinity).
|
gen_server:call(Pid, {mput, ObjectSpecs, TTL}, infinity).
|
||||||
|
|
||||||
-spec book_delete(pid(), any(), any(), leveled_codec:index_specs())
|
-spec book_delete(pid(), key(), key(), leveled_codec:index_specs())
|
||||||
-> ok|pause.
|
-> ok|pause.
|
||||||
|
|
||||||
%% @doc
|
%% @doc
|
||||||
|
@ -444,9 +445,9 @@ book_delete(Pid, Bucket, Key, IndexSpecs) ->
|
||||||
book_put(Pid, Bucket, Key, delete, IndexSpecs, ?STD_TAG).
|
book_put(Pid, Bucket, Key, delete, IndexSpecs, ?STD_TAG).
|
||||||
|
|
||||||
|
|
||||||
-spec book_get(pid(), any(), any(), leveled_codec:tag())
|
-spec book_get(pid(), key(), key(), leveled_codec:tag())
|
||||||
-> {ok, any()}|not_found.
|
-> {ok, any()}|not_found.
|
||||||
-spec book_head(pid(), any(), any(), leveled_codec:tag())
|
-spec book_head(pid(), key(), key(), leveled_codec:tag())
|
||||||
-> {ok, any()}|not_found.
|
-> {ok, any()}|not_found.
|
||||||
|
|
||||||
%% @doc - GET and HEAD requests
|
%% @doc - GET and HEAD requests
|
||||||
|
|
|
@ -40,8 +40,6 @@
|
||||||
{info, "Bucket list finds no more results"}},
|
{info, "Bucket list finds no more results"}},
|
||||||
{"B0009",
|
{"B0009",
|
||||||
{info, "Bucket list finds Bucket ~w"}},
|
{info, "Bucket list finds Bucket ~w"}},
|
||||||
{"B0010",
|
|
||||||
{info, "Bucket list finds non-binary Bucket ~w"}},
|
|
||||||
{"B0011",
|
{"B0011",
|
||||||
{warn, "Call to destroy the store and so all files to be removed"}},
|
{warn, "Call to destroy the store and so all files to be removed"}},
|
||||||
{"B0013",
|
{"B0013",
|
||||||
|
|
|
@ -458,10 +458,7 @@ get_nextbucket(NextBucket, NextKey, Tag, LedgerSnapshot, BKList, {C, L}) ->
|
||||||
leveled_codec:next_key(K)
|
leveled_codec:next_key(K)
|
||||||
end,
|
end,
|
||||||
get_nextbucket(B, NK, Tag, LedgerSnapshot, BKList, {C, L})
|
get_nextbucket(B, NK, Tag, LedgerSnapshot, BKList, {C, L})
|
||||||
end;
|
end
|
||||||
{NB, _V} ->
|
|
||||||
leveled_log:log("B0010",[NB]),
|
|
||||||
[]
|
|
||||||
end.
|
end.
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue