mirror of
https://github.com/FluuxIO/go-xmpp.git
synced 2024-11-21 18:12:00 -08:00
c6f0d03f60
Refactor and clean up pubsub & pep files
40 lines
764 B
Go
40 lines
764 B
Go
package xmpp // import "gosrc.io/xmpp"
|
|
|
|
import (
|
|
"encoding/xml"
|
|
)
|
|
|
|
type PubSub struct {
|
|
XMLName xml.Name `xml:"http://jabber.org/protocol/pubsub pubsub"`
|
|
Publish Publish
|
|
Retract Retract
|
|
// TODO <configure/>
|
|
}
|
|
|
|
func (p *PubSub) Namespace() string {
|
|
return p.XMLName.Space
|
|
}
|
|
|
|
type Publish struct {
|
|
XMLName xml.Name `xml:"publish"`
|
|
Node string `xml:"node,attr"`
|
|
Item Item
|
|
}
|
|
|
|
type Item struct {
|
|
XMLName xml.Name `xml:"item"`
|
|
Id string `xml:"id,attr,omitempty"`
|
|
Tune Tune
|
|
}
|
|
|
|
type Retract struct {
|
|
XMLName xml.Name `xml:"retract"`
|
|
Node string `xml:"node,attr"`
|
|
Notify string `xml:"notify,attr"`
|
|
Item Item
|
|
}
|
|
|
|
func init() {
|
|
TypeRegistry.MapExtension(PKTIQ, xml.Name{"http://jabber.org/protocol/pubsub", "pubsub"}, PubSub{})
|
|
}
|