saslerr

package
v0.18.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 14, 2021 License: BSD-2-Clause Imports: 4 Imported by: 0

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

MarshalXML satisfies the xml.Marshaler interface for a Failure.

func (Failure) TokenReader added in v0.18.0

func (f Failure) TokenReader() xml.TokenReader

TokenReader implements the xmlstream.Marshaler interface.

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

func (Failure) WriteXML added in v0.18.0

func (f Failure) WriteXML(w xmlstream.TokenWriter) (int, error)

WriteXML implements the xmlstream.WriterTo interface.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL