xmpp: mellium.im/xmpp/internal/saslerr Index | Files

package saslerr

import "mellium.im/xmpp/internal/saslerr"

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

Index

Package Files

errors.go

Constants

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.

type Failure Uses

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

Failure represents a SASL error that is marshalable to XML.

func (Failure) Error Uses

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 Uses

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

MarshalXML satisfies the xml.Marshaler interface for a Failure.

func (*Failure) UnmarshalXML Uses

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).

Package saslerr imports 3 packages (graph) and is imported by 2 packages. Updated 2018-10-17. Refresh now. Tools for package owners.