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 ¶
This section is empty.
Types ¶
type IQ ¶ added in v0.3.0
IQ is encoded as a ping request.
Example ¶
package main import ( "encoding/xml" "log" "os" "mellium.im/xmpp/jid" "mellium.im/xmpp/ping" "mellium.im/xmpp/stanza" ) func main() { j := jid.MustParse("feste@example.net/siJo4eeT") e := xml.NewEncoder(os.Stdout) e.Indent("", "\t") ping := ping.IQ{ IQ: stanza.IQ{To: j}, } err := e.Encode(ping) if err != nil { log.Fatal(err) } }
Output: <iq id="" to="feste@example.net/siJo4eeT" from="" type="get"> <ping xmlns="urn:xmpp:ping"></ping> </iq>
func (IQ) TokenReader ¶ added in v0.14.0
func (iq IQ) TokenReader() xml.TokenReader
TokenReader satisfies the xmlstream.Marshaler interface.
Click to show internal directories.
Click to hide internal directories.