View Source nova_session behaviour (nova v0.9.4)

All kind of operations on sessions is handled by the nova_session-module. The module also presents a behaviour that can be used to create customized backends for the session-data.

Link to this section Summary

Link to this section Callbacks

-callback delete_value(SessionId) -> ok | {error, Reason :: atom()} when SessionId :: binary().
-callback delete_value(SessionId, Key) -> ok | {error, Reason :: atom()}
                when SessionId :: binary(), Key :: binary().
-callback get_value(SessionId, Key) -> {ok, Value :: any()} | {error, Reason :: atom()}
             when SessionId :: binary(), Key :: binary().
-callback set_value(SessionId, Key, Value) -> ok | {error, Reason :: atom()}
             when SessionId :: binary(), Key :: binary(), Value :: binary().

Link to this section Functions

-spec delete(Req :: cowboy_req:req()) -> {ok, Req :: cowboy_req:req()} | {error, Reason :: atom()}.
-spec delete(Req :: cowboy_req:req(), Key :: binary()) ->
          {ok, Req :: cowboy_req:req()} | {error, Reason :: atom()} | no_return().
-spec get(Req :: cowboy_req:req(), Key :: binary()) ->
       {ok, Value :: binary()} | {error, Reason :: atom()} | no_return().
-spec set(Req :: cowboy_req:req(), Key :: binary(), Value :: binary()) ->
       ok | {error, Reason :: atom()} | no_return().