structs.go
changeset 112 bd56fb741f69
parent 111 36287f2cf06e
child 115 7c45fc3f524a
equal deleted inserted replaced
111:36287f2cf06e 112:bd56fb741f69
    75 	Chardata  string `xml:",chardata"`
    75 	Chardata  string `xml:",chardata"`
    76 	Mechanism string `xml:"mechanism,attr,omitempty"`
    76 	Mechanism string `xml:"mechanism,attr,omitempty"`
    77 	Any       *Generic
    77 	Any       *Generic
    78 }
    78 }
    79 
    79 
    80 type Stanzer interface {
    80 type Stanza interface {
    81 	GetHeader() *Header
    81 	GetHeader() *Header
    82 }
    82 }
    83 
    83 
    84 // One of the three core XMPP stanza types: iq, message, presence. See
    84 // One of the three core XMPP stanza types: iq, message, presence. See
    85 // RFC3920, section 9.
    85 // RFC3920, section 9.
   100 	Header
   100 	Header
   101 	Subject  *Generic `xml:"subject"`
   101 	Subject  *Generic `xml:"subject"`
   102 	Body     *Generic `xml:"body"`
   102 	Body     *Generic `xml:"body"`
   103 	Thread   *Generic `xml:"thread"`
   103 	Thread   *Generic `xml:"thread"`
   104 }
   104 }
   105 var _ Stanzer = &Message{}
   105 var _ Stanza = &Message{}
   106 
   106 
   107 // presence stanza
   107 // presence stanza
   108 type Presence struct {
   108 type Presence struct {
   109 	XMLName  xml.Name `xml:"presence"`
   109 	XMLName  xml.Name `xml:"presence"`
   110 	Header
   110 	Header
   111 	Show     *Generic `xml:"show"`
   111 	Show     *Generic `xml:"show"`
   112 	Status   *Generic `xml:"status"`
   112 	Status   *Generic `xml:"status"`
   113 	Priority *Generic `xml:"priority"`
   113 	Priority *Generic `xml:"priority"`
   114 }
   114 }
   115 var _ Stanzer = &Presence{}
   115 var _ Stanza = &Presence{}
   116 
   116 
   117 // iq stanza
   117 // iq stanza
   118 type Iq struct {
   118 type Iq struct {
   119 	XMLName  xml.Name `xml:"iq"`
   119 	XMLName  xml.Name `xml:"iq"`
   120 	Header
   120 	Header
   121 }
   121 }
   122 var _ Stanzer = &Iq{}
   122 var _ Stanza = &Iq{}
   123 
   123 
   124 // Describes an XMPP stanza error. See RFC 3920, Section 9.3.
   124 // Describes an XMPP stanza error. See RFC 3920, Section 9.3.
   125 type Error struct {
   125 type Error struct {
   126 	XMLName xml.Name `xml:"error"`
   126 	XMLName xml.Name `xml:"error"`
   127 	// The error type attribute.
   127 	// The error type attribute.