Documentation

Overview

Package saslerr provides error conditions for the XMPP profile of SASL as defined by RFC 6120 §6.5.

Index

Constants

View Source
const (
	Aborted              condition = "aborted"
	AccountDisabled      condition = "account-disabled"
	CredentialsExpired   condition = "credentials-expired"
	EncryptionRequired   condition = "encryption-required"
	IncorrectEncoding    condition = "incorrect-encoding"
	InvalidAuthzID       condition = "invalid-authzid"
	InvalidMechanism     condition = "invalid-mechanism"
	MalformedRequest     condition = "malformed-request"
	MechanismTooWeak     condition = "mechanism-too-weak"
	NotAuthorized        condition = "not-authorized"
	TemporaryAuthFailure condition = "temporary-auth-failure"
)

Standard SASL error conditions.

Variables

This section is empty.

Functions

This section is empty.

Types

type Failure

type Failure struct {
	Condition condition
	Lang      language.Tag
	Text      string
}

Failure represents a SASL error that is marshalable to XML.

func (Failure) Error

func (f Failure) Error() string

Error satisfies the error interface for a Failure. It returns the text string if set, or the condition otherwise.

func (Failure) MarshalXML

func (f Failure) MarshalXML(e *xml.Encoder, start xml.StartElement) (err error)

MarshalXML satisfies the xml.Marshaler interface for a Failure.

func (*Failure) UnmarshalXML

func (f *Failure) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

UnmarshalXML satisfies the xml.Unmarshaler interface for a Failure. If multiple text elements are present in the XML and the Failure struct already has a language tag set, UnmarshalXML selects the text element with an xml:lang attribute that most closely matches the features language tag. If no language tag is present, UnmarshalXML selects a text element with an xml:lang attribute of "und" if present, behavior is undefined otherwise (it will pick the tag that most closely matches "und", whatever that means).

Source Files