Module m_server_storage

Model for server side data storage.

Copyright © 2020 Marc Worrell

Behaviours: zotonic_model.

Authors: Marc Worrell (marc@worrell.nl).

Description

Model for server side data storage.

Function Index

delete/1Delete all keys from the session.
delete/2Delete a key from the session.
lookup/1Find all keys in the session.
lookup/2Find a key in the session.
m_delete/3
m_get/3
m_post/3
ping/1Ping the session to keep it alive.
secure_delete/1Delete all keys from the session, without access via the model access functions.
secure_delete/2Delete a key from the session, without access via the model access functions.
secure_lookup/1Find all keys in the secure session, without access via the model access functions.
secure_lookup/2Find a key in the secure session, without access via the model access functions.
secure_store/3Store a key/valye in the session, without access via the model access functions.
store/3Store a key in the session.

Function Details

delete/1

delete(Context::z:context()) -> ok | {error, no_session | not_found | term()}

Delete all keys from the session.

delete/2

delete(Key::term(), Context::z:context()) -> ok | {error, no_session | not_found | term()}

Delete a key from the session.

lookup/1

lookup(Context::z:context()) -> {ok, map()} | {error, no_session | not_found | term()}

Find all keys in the session.

lookup/2

lookup(Key::term(), Context::z:context()) -> {ok, term()} | {error, no_session | not_found | term()}

Find a key in the session.

m_delete/3

m_delete(Path::[binary()], Msg::zotonic_model:opt_msg(), Context::z:context()) -> {ok, term()} | {error, term()}

m_get/3

m_get(Rest::list(), Msg::zotonic_model:opt_msg(), Context::z:context()) -> zotonic_model:return()

m_post/3

m_post(Path::[binary()], Msg::zotonic_model:opt_msg(), Context::z:context()) -> {ok, term()} | {error, term()}

ping/1

ping(Context::z:context()) -> ok | {error, no_session | term()}

Ping the session to keep it alive.

secure_delete/1

secure_delete(Context::z:context()) -> ok | {error, no_session | not_found | term()}

Delete all keys from the session, without access via the model access functions.

secure_delete/2

secure_delete(Key::term(), Context::z:context()) -> {ok, term()} | {error, no_session | not_found | term()}

Delete a key from the session, without access via the model access functions.

secure_lookup/1

secure_lookup(Context::z:context()) -> {ok, term()} | {error, no_session | not_found | term()}

Find all keys in the secure session, without access via the model access functions.

secure_lookup/2

secure_lookup(Key::term(), Context::z:context()) -> {ok, term()} | {error, no_session | not_found | term()}

Find a key in the secure session, without access via the model access functions.

secure_store/3

secure_store(Key::term(), Value::term(), Context::z:context()) -> ok | {error, no_session | not_found | term()}

Store a key/valye in the session, without access via the model access functions.

store/3

store(Key::term(), Value::term(), Context::z:context()) -> ok | {error, no_session | not_found | full | term()}

Store a key in the session.


Generated by EDoc