Exampple.Router.Conn (exampple v0.10.6)

Conn is a module to store the information related to a XMPP request. Conn has the following information inside:

  • domain: the component domain.
  • from_jid: the JID where the stanza is coming from.
  • to_jid: the JID where the stanza is sent to.
  • id: the ID for the stanza.
  • type: the type attribute of the stanza. Depending on the stanza type it could be chat, groupchat, normal, get, set, ...
  • xmlns: the namespace for the XML stanza.
  • stanza_type: the stanza type, it could be iq, message or presence. It is possible to receive other kind of XML stanzas, but it is not common.
  • stanza: the original stanza in %Xmlel{} format.
  • reponse: the generated response in use if we pass the connection to the Exampple.Component module.
  • envelope: it is an anonymous function needed if we are receiving stanzas which are using an envelope. It is not needed to handle it manually, see further information about this in Exampple.Router.

Link to this section Summary

Functions

Obtains the response stored inside of the conn. Checking if there is an envelope used or not.

Creates a new connection passing a %Xmlel{} struct in xmlel as the first parameter and a domain as a second parameter (or nil by default) to create a %Conn{} struct.

Link to this section Types

Specs

t() :: %Exampple.Router.Conn{
  domain: String.t() | nil,
  envelope: (Exampple.Xml.Xmlel.t() -> Exampple.Xml.Xmlel.t()) | nil,
  from_jid: Exampple.Xmpp.Jid.t() | nil,
  id: String.t() | nil,
  response: Exampple.Xml.Xmlel.t() | nil,
  stanza: Exampple.Xml.Xmlel.t() | nil,
  stanza_type: String.t() | nil,
  to_jid: Exampple.Xmpp.Jid.t() | nil,
  type: String.t() | nil,
  xmlns: String.t() | nil
}

Link to this section Functions

Link to this function

get_response(conn)

Obtains the response stored inside of the conn. Checking if there is an envelope used or not.

Link to this function

new(xmlel, domain \\ nil)

Creates a new connection passing a %Xmlel{} struct in xmlel as the first parameter and a domain as a second parameter (or nil by default) to create a %Conn{} struct.