mirror of
https://github.com/FluuxIO/go-xmpp.git
synced 2024-11-25 12:02:01 -08:00
8798ff6fc1
- Fixed commands from v 0.4.0 and tests - Added primitive Result Sets support (XEP-0059)
49 lines
1.0 KiB
Go
49 lines
1.0 KiB
Go
package stanza
|
|
|
|
import (
|
|
"encoding/xml"
|
|
)
|
|
|
|
type ControlSet struct {
|
|
XMLName xml.Name `xml:"urn:xmpp:iot:control set"`
|
|
Fields []ControlField `xml:",any"`
|
|
// Result sets
|
|
ResultSet *ResultSet `xml:"set,omitempty"`
|
|
}
|
|
|
|
func (c *ControlSet) Namespace() string {
|
|
return c.XMLName.Space
|
|
}
|
|
|
|
func (c *ControlSet) GetSet() *ResultSet {
|
|
return c.ResultSet
|
|
}
|
|
|
|
type ControlGetForm struct {
|
|
XMLName xml.Name `xml:"urn:xmpp:iot:control getForm"`
|
|
}
|
|
|
|
type ControlField struct {
|
|
XMLName xml.Name
|
|
Name string `xml:"name,attr,omitempty"`
|
|
Value string `xml:"value,attr,omitempty"`
|
|
}
|
|
|
|
type ControlSetResponse struct {
|
|
XMLName xml.Name `xml:"urn:xmpp:iot:control setResponse"`
|
|
}
|
|
|
|
func (c *ControlSetResponse) Namespace() string {
|
|
return c.XMLName.Space
|
|
}
|
|
func (c *ControlSetResponse) GetSet() *ResultSet {
|
|
return nil
|
|
}
|
|
|
|
// ============================================================================
|
|
// Registry init
|
|
|
|
func init() {
|
|
TypeRegistry.MapExtension(PKTIQ, xml.Name{Space: "urn:xmpp:iot:control", Local: "set"}, ControlSet{})
|
|
}
|