Documentation ¶
Overview ¶
Package ping implements XEP-0199: XMPP Ping.
Index ¶
Examples ¶
Constants ¶
View Source
const NS = `urn:xmpp:ping`
NS is the XML namespace used by XMPP pings. It is provided as a convenience.
Variables ¶
This section is empty.
Functions ¶
func IQ ¶ added in v0.3.0
func IQ(to jid.JID) xml.TokenReader
IQ returns an xml.TokenReader that outputs a new IQ stanza with a ping payload.
Example ¶
package main import ( "encoding/xml" "log" "os" "mellium.im/xmlstream" "mellium.im/xmpp/jid" "mellium.im/xmpp/ping" ) func main() { j := jid.MustParse("feste@example.net/siJo4eeT") e := xml.NewEncoder(os.Stdout) e.Indent("", "\t") ping := ping.IQ(j) if _, err := xmlstream.Copy(e, ping); err != nil { log.Fatal(err) } if err := e.Flush(); err != nil { log.Fatal(err) } }
Output: <iq type="get" to="feste@example.net/siJo4eeT"> <ping xmlns="urn:xmpp:ping"></ping> </iq>
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.