Skip to content

Latest commit

 

History

History
105 lines (63 loc) · 3.94 KB

elli_cache_util.md

File metadata and controls

105 lines (63 loc) · 3.94 KB

Module elli_cache_util

Useful helper functions for elli_cache.

Copyright (c) 2016, elli-lib team

Authors: Eric Bailey (eric@ericb.me) (web site: https://github.com/yurrriq).

Function Index

comma_split/1
compare_date/3
convert_date/1
get_values/2
ifdef_delete/3If List1 contains at least one entry associated with Key1, delete all entries associated with Key2.
maybe_get_value/2
store/3
update_element/3

Function Details

comma_split/1


comma_split(Subject::binary()) -> [binary()]

compare_date/3


compare_date(Comp, Date1, Date2) -> maybe_m:maybe(boolean())

convert_date/1


convert_date(Date) -> maybe_m:maybe(Seconds)

get_values/2


get_values(Key::binary(), Headers::elli:headers()) -> [binary()]

ifdef_delete/3


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/2


maybe_get_value(Key::binary(), Headers::elli:headers()) -> maybe_m:maybe(binary())

store/3


store(Key::binary(), Value::binary(), List::elli:headers()) -> elli:headers()

update_element/3


update_element(Index, Tuple1, Fun) -> Tuple2
  • Index = pos_integer()
  • Tuple1 = tuple()
  • Fun = fun((term()) -> term())
  • Tuple2 = tuple()