n2z.hrl 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. -ifndef(N2Z_HRL).
  2. -define(N2Z_HRL, true).
  3. -include_lib("kernel/include/logger.hrl").
  4. -define(LOG_EXCEPTION(E, R, S), ?LOG_ERROR(#{exception => E, reason => R, stack => S})).
  5. -record(pi, { name :: term(),
  6. table :: atom(),
  7. sup :: atom(),
  8. module :: atom(),
  9. state :: term() }).
  10. -record(cx, { handlers = [] :: list({atom(),atom()}),
  11. actions = [] :: list(tuple()),
  12. req = [] :: [] | term(),
  13. module = [] :: [] | atom() | list(),
  14. lang = [] :: [] | atom(),
  15. path = [] :: [] | binary(),
  16. session = [] :: [] | binary(),
  17. token = [] :: [] | binary(),
  18. formatter = bert :: bert | json | atom(),
  19. params = [] :: [] | list(tuple()) | binary() | list(),
  20. 'node' = [] :: [] | atom() | list(),
  21. client_pid= [] :: [] | term(),
  22. state = [] :: [] | term(),
  23. from = [] :: [] | binary(),
  24. vsn = [] :: [] | binary() }).
  25. %-define(CTX(ClientId), n2z:cache(ClientId)).
  26. %-define(REQ(ClientId), (n2z:cache(ClientId))#cx.req).
  27. % Nitrogen Protocol
  28. -include_lib("nitro/include/proto.hrl").
  29. -endif.