sum7
/
yaja
Archived
1
0
Fork 0
This repository has been archived on 2020-09-27. You can view files and clone it, but cannot push or open issues or pull requests.
yaja/messages/error.go

56 lines
2.8 KiB
Go
Raw Normal View History

2017-12-14 21:30:07 +01:00
package messages
import "encoding/xml"
2018-02-10 13:34:42 +01:00
type StreamError struct {
XMLName xml.Name `xml:"http://etherx.jabber.org/streams error"`
2018-02-11 11:15:11 +01:00
Text string `xml:"urn:ietf:params:xml:ns:xmpp-streams text"`
2018-02-10 13:34:42 +01:00
Any xml.Name `xml:",any"`
}
2018-02-11 15:11:52 +01:00
type ErrorClientType string
const (
ErrorClientTypeAuth ErrorClientType = "auth"
ErrorClientTypeCancel ErrorClientType = "cancel"
ErrorClientTypeContinue ErrorClientType = "continue"
ErrorClientTypeModify ErrorClientType = "motify"
ErrorClientTypeWait ErrorClientType = "wait"
)
type StanzaErrorGroup struct {
BadRequest *xml.Name `xml:"urn:ietf:params:xml:ns:xmpp-stanzas bad-request"`
Conflict *xml.Name `xml:"urn:ietf:params:xml:ns:xmpp-stanzas conflict"`
FeatureNotImplemented *xml.Name `xml:"urn:ietf:params:xml:ns:xmpp-stanzas feature-not-implemented"`
Forbidden *xml.Name `xml:"urn:ietf:params:xml:ns:xmpp-stanzas forbidden"`
Gone string `xml:"urn:ietf:params:xml:ns:xmpp-stanzas gone"`
InternalServerError *xml.Name `xml:"urn:ietf:params:xml:ns:xmpp-stanzas internal-server-error"`
ItemNotFound *xml.Name `xml:"urn:ietf:params:xml:ns:xmpp-stanzas item-not-found"`
JIDMalformed *xml.Name `xml:"urn:ietf:params:xml:ns:xmpp-stanzas jid-malformed"`
NotAcceptable *xml.Name `xml:"urn:ietf:params:xml:ns:xmpp-stanzas not-acceptable"`
NotAllowed *xml.Name `xml:"urn:ietf:params:xml:ns:xmpp-stanzas not-allowed"`
NotAuthorized *xml.Name `xml:"urn:ietf:params:xml:ns:xmpp-stanzas not-authorized"`
PolicyViolation *xml.Name `xml:"urn:ietf:params:xml:ns:xmpp-stanzas policy-violation"`
RecipientUnavailable *xml.Name `xml:"urn:ietf:params:xml:ns:xmpp-stanzas recipient-unavailable"`
Redirect string `xml:"urn:ietf:params:xml:ns:xmpp-stanzas redirect"`
RegistrationRequired *xml.Name `xml:"urn:ietf:params:xml:ns:xmpp-stanzas registration-required"`
RemoteServerNotFound *xml.Name `xml:"urn:ietf:params:xml:ns:xmpp-stanzas remote-server-not-found"`
RemoteServerTimeout *xml.Name `xml:"urn:ietf:params:xml:ns:xmpp-stanzas remote-server-timeout"`
ResourceConstraint *xml.Name `xml:"urn:ietf:params:xml:ns:xmpp-stanzas resource-constraint"`
ServiceUnavailable *xml.Name `xml:"urn:ietf:params:xml:ns:xmpp-stanzas service-unavailable"`
SubscriptionRequired *xml.Name `xml:"urn:ietf:params:xml:ns:xmpp-stanzas subscription-required"`
UndefinedCondition *xml.Name `xml:"urn:ietf:params:xml:ns:xmpp-stanzas undefined-condition"`
UnexpectedRequest *xml.Name `xml:"urn:ietf:params:xml:ns:xmpp-stanzas unexpected-request"`
}
// ErrorClient element
type ErrorClient struct {
2018-02-11 15:11:52 +01:00
XMLName xml.Name `xml:"jabber:client error"`
Code string `xml:"code,attr"`
Type ErrorClientType `xml:"type,attr"`
Text string `xml:"text"`
Other []XMLElement `xml:",any"`
StanzaErrorGroup
2017-12-14 21:30:07 +01:00
}