Useful helper functions for elli_cache.
Copyright (c) 2016, elli-lib team
Authors: Eric Bailey (eric@ericb.me
) (web site: https://github.com/yurrriq
).
comma_split/1 | |
compare_date/3 | |
convert_date/1 | |
get_values/2 | |
ifdef_delete/3 | If List1 contains at least one entry associated with Key1 ,
delete all entries associated with Key2 . |
maybe_get_value/2 | |
store/3 | |
update_element/3 |
comma_split(Subject::binary()) -> [binary()]
compare_date(Comp, Date1, Date2) -> maybe_m:maybe(boolean())
Comp = fun((Seconds1, Seconds2) -> boolean())
Seconds1 = non_neg_integer()
Seconds2 = non_neg_integer()
Date1 = binary() | calendar:datetime()
Date2 = binary() | calendar:datetime()
convert_date(Date) -> maybe_m:maybe(Seconds)
Date = binary() | calendar:datetime()
Seconds = non_neg_integer()
get_values(Key::binary(), Headers::elli:headers()) -> [binary()]
ifdef_delete(Key1, Key2, List1) -> List2
Key1 = term()
Key2 = term()
List1 = [term()]
List2 = [term()]
If List1
contains at least one entry associated with Key1
,
delete all entries associated with Key2
. Otherwise, return List1
.
maybe_get_value(Key::binary(), Headers::elli:headers()) -> maybe_m:maybe(binary())
store(Key::binary(), Value::binary(), List::elli:headers()) -> elli:headers()
update_element(Index, Tuple1, Fun) -> Tuple2
Index = pos_integer()
Tuple1 = tuple()
Fun = fun((term()) -> term())
Tuple2 = tuple()