Documentation ¶
Overview ¶
Package saslerr provides error conditions for the XMPP profile of SASL as defined by RFC 6120 §6.5.
Index ¶
- type Condition
- func (c Condition) MarshalXML(e *xml.Encoder, start xml.StartElement) error
- func (i Condition) String() string
- func (c Condition) TokenReader() xml.TokenReader
- func (c *Condition) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error
- func (c Condition) WriteXML(w xmlstream.TokenWriter) (int, error)
- type Error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Condition ¶ added in v0.21.4
type Condition uint16
Condition represents a SASL error condition that can be encapsulated by a <failure/> element.
const ( // None is a special condition that is used only if a defined condition was // not present. Its use violates the spec. ConditionNone Condition = iota // none ConditionAborted // aborted ConditionAccountDisabled // account-disabled ConditionCredentialsExpired // credentials-expired ConditionEncryptionRequired // encryption-required ConditionIncorrectEncoding // incorrect-encoding ConditionInvalidAuthzID // invalid-authzid ConditionInvalidMechanism // invalid-mechanism ConditionMalformedRequest // malformed-request ConditionMechanismTooWeak // mechanism-too-weak ConditionNotAuthorized // not-authorized ConditionTemporaryAuthFailure // temporary-auth-failure )
Standard SASL error conditions.
func (Condition) MarshalXML ¶ added in v0.21.4
MarshalXML satisfies the xml.Marshaler interface for a Failure.
func (Condition) TokenReader ¶ added in v0.21.4
func (c Condition) TokenReader() xml.TokenReader
TokenReader implements the xmlstream.Marshaler interface.
func (*Condition) UnmarshalXML ¶ added in v0.21.4
UnmarshalXML satisfies the xml.Unmarshaler interface.
type Error ¶ added in v0.21.4
Error represents a SASL error that is marshalable to XML.
func (Error) Error ¶ added in v0.21.4
Error satisfies the error interface for a Failure. It returns the text string if set, or the condition otherwise.
func (Error) MarshalXML ¶ added in v0.21.4
MarshalXML satisfies the xml.Marshaler interface for a Failure.
func (Error) TokenReader ¶ added in v0.21.4
func (f Error) TokenReader() xml.TokenReader
TokenReader implements the xmlstream.Marshaler interface.
func (*Error) UnmarshalXML ¶ added in v0.21.4
UnmarshalXML satisfies the xml.Unmarshaler interface for a Failure.
If multiple text elements are present in the XML, UnmarshalXML selects the text element with an xml:lang attribute that exactly matches the language tag. If no language tag in the XML matches the behavior is undefined and may change at a later date or depending on the server order of tags.