data

package
v0.4.0-el2 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2021 License: GPL-3.0 Imports: 9 Imported by: 50

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Any

type Any struct {
	XMLName xml.Name
	Body    string `xml:",innerxml"`
}

Any provides a convenient way to debug any child element

type BindBind

type BindBind struct {
	XMLName  xml.Name `xml:"urn:ietf:params:xml:ns:xmpp-bind bind"`
	Resource string   `xml:"resource"`
	Jid      string   `xml:"jid"`
}

BindBind represents a bind RFC 6120, section 7

type BobData

type BobData struct {
	XMLName  xml.Name `xml:"urn:xmpp:bob data"`
	CID      string   `xml:"cid,attr"`
	MIMEType string   `xml:"type,attr"`
	Base64   string   `xml:",chardata"`
}

BobData is a data element from http://xmpp.org/extensions/xep-0231.html.

type BooleanFormField

type BooleanFormField struct {
	FormField

	Result bool
}

BooleanFormField is for a yes/no answer. The Result member should be set to the user's answer.

type BytestreamQuery added in v0.3.9

type BytestreamQuery struct {
	XMLName            xml.Name                  `xml:"http://jabber.org/protocol/bytestreams query"`
	Sid                string                    `xml:"sid,attr"`
	DestinationAddress string                    `xml:"dstaddr,attr,omitempty"`
	Mode               string                    `xml:"mode,attr,omitempty"`
	Activate           string                    `xml:"activate,omitempty"`
	Streamhosts        []BytestreamStreamhost    `xml:"streamhost"`
	StreamhostUsed     *BytestreamStreamhostUsed `xml:"streamhost-used,omitempty"`
}

BytestreamQuery is an element from http://xmpp.org/extensions/xep-0065.html.

type BytestreamStreamhost added in v0.3.9

type BytestreamStreamhost struct {
	XMLName xml.Name `xml:"http://jabber.org/protocol/bytestreams streamhost"`
	Jid     string   `xml:"jid,attr"`
	Host    string   `xml:"host,attr"`
	Port    int      `xml:"port,attr,omitempty"` // default 1080
}

BytestreamStreamhost is an element from http://xmpp.org/extensions/xep-0065.html.

type BytestreamStreamhostUsed added in v0.3.9

type BytestreamStreamhostUsed struct {
	XMLName xml.Name `xml:"http://jabber.org/protocol/bytestreams streamhost-used"`
	Jid     string   `xml:"jid,attr"`
}

BytestreamStreamhostUsed is an element from http://xmpp.org/extensions/xep-0065.html.

type CaptchaFormField

type CaptchaFormField struct {
	MediaForm *Media
	TextForm  *TextFormField
}

CaptchaFormField handles the Captcha image element. It has two elements inside in order to contain the Media and TextForm. The first one contain the image to be desplayed in the dialog box and the last one is for render the Input Text of the captcha image displayed.

type ClientCaps

type ClientCaps struct {
	XMLName xml.Name `xml:"http://jabber.org/protocol/caps c"`
	Ext     string   `xml:"ext,attr"`
	Hash    string   `xml:"hash,attr"`
	Node    string   `xml:"node,attr"`
	Ver     string   `xml:"ver,attr"`
}

ClientCaps contains information about client capabilities

type ClientIQ

type ClientIQ struct {
	XMLName xml.Name    `xml:"jabber:client iq"`
	From    string      `xml:"from,attr"`
	ID      string      `xml:"id,attr"`
	To      string      `xml:"to,attr"`
	Type    string      `xml:"type,attr"` // error, get, result, set
	Error   StanzaError `xml:"jabber:client error"`
	Bind    BindBind    `xml:"bind"`
	Query   []byte      `xml:",innerxml"`
}

ClientIQ contains a specific information query request

type ClientMessage

type ClientMessage struct {
	XMLName xml.Name `xml:"jabber:client message"`
	From    string   `xml:"from,attr"`
	ID      string   `xml:"id,attr"`
	To      string   `xml:"to,attr"`
	Type    string   `xml:"type,attr"` // chat, error, groupchat, headline, or normal

	// These should technically be []clientText,
	// but string is much more convenient.
	Subject    *Subject    `xml:",omitempty"`
	Body       string      `xml:"body"`
	Thread     string      `xml:"thread"`
	Delay      *Delay      `xml:"delay,omitempty"`
	Encryption *Encryption `xml:"encryption,omitempty"`

	Error *StanzaError `xml:"error"`

	MUCUser *MUCUser `xml:",omitempty"`

	Extensions `xml:",any,omitempty"`
}

ClientMessage implements RFC 3921 B.1 jabber:client

type ClientPresence

type ClientPresence struct {
	XMLName xml.Name `xml:"jabber:client presence"`
	From    string   `xml:"from,attr,omitempty"`
	ID      string   `xml:"id,attr,omitempty"`
	To      string   `xml:"to,attr,omitempty"`
	Type    string   `xml:"type,attr,omitempty"` // error, probe, subscribe, subscribed, unavailable, unsubscribe, unsubscribed
	Lang    string   `xml:"lang,attr,omitempty"`

	Show     string      `xml:"show,omitempty"`   // away, chat, dnd, xa
	Status   string      `xml:"status,omitempty"` // sb []clientText
	Priority string      `xml:"priority,omitempty"`
	Caps     *ClientCaps `xml:"c"`

	Error *StanzaError `xml:"jabber:client error"`
	Delay *Delay       `xml:"delay,omitempty"`

	Unknown string   `xml:",innerxml"`
	MUC     *MUC     `xml:",omitempty"`
	MUCUser *MUCUser `xml:",omitempty"`
}

ClientPresence contains XMPP information about a presence update

type Config

type Config struct {
	// InLog is an optional Writer which receives the raw contents of the
	// XML from the server.
	InLog io.Writer
	// OutLog is an optional Writer which receives the raw XML sent to the
	// server.
	OutLog io.Writer
	// Log is an optional Writer which receives human readable log messages
	// during the connection.
	Log io.Writer
	// CreateCallback, if not nil, causes a new account to be created on
	// the server. The callback is needed in order to be able to handle
	// XMPP forms.
	CreateCallback FormCallback
	// Archive determines whether we disable archiving for messages. If
	// false, XML is sent with each message to disable recording on the
	// server.
	Archive bool
	// SkipTLS, if true, causes the TLS handshake to be skipped.
	// WARNING: this should only be used if Conn is already secure.
	SkipTLS bool
	// TLSConfig contains the configuration to be used by the TLS
	// handshake. If nil, sensible defaults will be used.
	TLSConfig *tls.Config
	// SkipSRVLookup skips SRV lookup during resolution of fully qualified domain
	// names. RFC 6120 section 3.2.3 recomends to skip the SRV lookup when the
	// initiating entity has a hardcoded FQDN associated with the origin domain.
	SkipSRVLookup bool
}

Config contains options for an XMPP connection.

func (*Config) GetLog

func (c *Config) GetLog() io.Writer

GetLog returns the log to use for logging, either a discard or a real log

type Cookie uint64

Cookie is used to give a unique identifier to each request.

type Delay

type Delay struct {
	XMLName xml.Name `xml:"urn:xmpp:delay delay"`
	From    string   `xml:"from,attr,omitempty"`
	Stamp   string   `xml:"stamp,attr"`

	Body string `xml:",chardata"`
}

Delay represents XEP-0203: Delayed Delivery of <message/> and <presence/> stanzas.

type DiscoveryFeature

type DiscoveryFeature struct {
	XMLName xml.Name `xml:"http://jabber.org/protocol/disco#info feature"`
	Var     string   `xml:"var,attr"`
}

DiscoveryFeature contains information about a specific discovery feature

type DiscoveryIdentity

type DiscoveryIdentity struct {
	XMLName  xml.Name `xml:"http://jabber.org/protocol/disco#info identity"`
	Lang     string   `xml:"lang,attr,omitempty"`
	Category string   `xml:"category,attr"`
	Type     string   `xml:"type,attr"`
	Name     string   `xml:"name,attr"`
}

DiscoveryIdentity contains identity information for a specific discovery

type DiscoveryInfoQuery added in v0.3.9

type DiscoveryInfoQuery struct {
	XMLName    xml.Name            `xml:"http://jabber.org/protocol/disco#info query"`
	Node       string              `xml:"node,omitempty"`
	Identities []DiscoveryIdentity `xml:"identity,omitempty"`
	Features   []DiscoveryFeature  `xml:"feature,omitempty"`
	Forms      []Form              `xml:"jabber:x:data x,omitempty"`
	ResultSet  *ResultSet          `xml:"set,omitempty"`
}

DiscoveryInfoQuery contains the deserialized information about a service discovery info query See: XEP-0030, Section 3

type DiscoveryItem added in v0.3.9

type DiscoveryItem struct {
	XMLName xml.Name `xml:"http://jabber.org/protocol/disco#items item"`
	Jid     string   `xml:"jid,attr"`
	Name    string   `xml:"name,attr"`
}

DiscoveryItem contains one discovery item

type DiscoveryItemsQuery added in v0.3.9

type DiscoveryItemsQuery struct {
	XMLName        xml.Name        `xml:"http://jabber.org/protocol/disco#items query"`
	Node           string          `xml:"node,omitempty"`
	DiscoveryItems []DiscoveryItem `xml:"item,omitempty"`
}

DiscoveryItemsQuery contains a query for discovery items

type EmptyReply

type EmptyReply struct {
}

An EmptyReply results is in no XML.

type EncryptedData added in v0.3.9

type EncryptedData struct {
	XMLName              xml.Name              `xml:"http://jabber.org/protocol/si/profile/encrypted-data-transfer data"`
	Type                 string                `xml:"type,omitempty"`
	MediaType            string                `xml:"media-type,omitempty"`
	Name                 string                `xml:"name,omitempty"`
	Size                 int64                 `xml:"size,omitempty"`
	Desc                 string                `xml:"desc,omitempty"`
	Date                 string                `xml:"date,omitempty"`
	Range                *FileRange            `xml:",omitempty"`
	Hash                 *Hash                 `xml:"hash,omitempty"`
	EncryptionParameters *EncryptionParameters `xml:"encryption,omitempty"`
}

EncryptedData is an element from an unpublished potential XEP

type Encryption

type Encryption struct {
	XMLName   xml.Name `xml:"urn:xmpp:eme:0 encryption"`
	Namespace string   `xml:"namespace,attr"`
	Name      string   `xml:"name,attr,omitempty"`
}

Encryption represents XEP-0380: Explicit Message Encryption

type EncryptionKeyParameter added in v0.3.9

type EncryptionKeyParameter struct {
	XMLName xml.Name `xml:"http://jabber.org/protocol/si/profile/encrypted-data-transfer encryption-key"`
	Type    string   `xml:"type,attr"` // 'static' or 'external'
	Value   string   `xml:"value,attr,omitempty"`
}

EncryptionKeyParameter is an element from an unpublished potential XEP

type EncryptionParameters added in v0.3.9

type EncryptionParameters struct {
	XMLName       xml.Name                `xml:"http://jabber.org/protocol/si/profile/encrypted-data-transfer encryption"`
	Type          string                  `xml:"type,attr"`
	IV            string                  `xml:"iv,attr"`
	MAC           string                  `xml:"mac,attr"`
	EncryptionKey *EncryptionKeyParameter `xml:"encryption-key"`
	MACKey        *MACKeyParameter        `xml:"mac-key"`
}

EncryptionParameters is an element from an unpublished potential XEP

type ErrorBadRequest

type ErrorBadRequest struct {
	XMLName xml.Name `xml:"urn:ietf:params:xml:ns:xmpp-stanzas bad-request"`
}

ErrorBadRequest reflects a bad-request stanza. See http://xmpp.org/rfcs/rfc6120.html#stanzas-error-conditions-bad-request

type ErrorForbidden added in v0.3.9

type ErrorForbidden struct {
	XMLName xml.Name `xml:"urn:ietf:params:xml:ns:xmpp-stanzas forbidden"`
}

ErrorForbidden reflects a forbidden stanza.

type ErrorItemNotFound added in v0.3.9

type ErrorItemNotFound struct {
	XMLName xml.Name `xml:"urn:ietf:params:xml:ns:xmpp-stanzas item-not-found"`
}

ErrorItemNotFound reflects an item not found stanza

type ErrorNoValidStreams added in v0.3.9

type ErrorNoValidStreams struct {
	XMLName xml.Name `xml:"http://jabber.org/protocol/si no-valid-streams"`
}

ErrorNoValidStreams reflects an error when no stream types offered were acceptable Ref: XEP-0095

type ErrorNotAcceptable added in v0.3.9

type ErrorNotAcceptable struct {
	XMLName xml.Name `xml:"urn:ietf:params:xml:ns:xmpp-stanzas not-acceptable"`
}

ErrorNotAcceptable reflects a not acceptable stanza

type ErrorReply

type ErrorReply struct {
	XMLName xml.Name    `xml:"error"`
	Type    string      `xml:"type,attr"`
	Code    int         `xml:"code,attr,omitempty"`
	Error   interface{} `xml:"error"`
	Error2  interface{} `xml:"error2,omitempty"`
	Text    string      `xml:"urn:ietf:params:xml:ns:xmpp-stanzas text,omitempty"`
}

ErrorReply reflects an XMPP error stanza. See http://xmpp.org/rfcs/rfc6120.html#stanzas-error-syntax

type ErrorServiceUnavailable

type ErrorServiceUnavailable struct {
	XMLName xml.Name `xml:"urn:ietf:params:xml:ns:xmpp-stanzas service-unavailable"`
}

ErrorServiceUnavailable reflects that a service is unavailable Ref: RFC-6120

type ErrorUnexpectedRequest added in v0.3.9

type ErrorUnexpectedRequest struct {
	XMLName xml.Name `xml:"urn:ietf:params:xml:ns:xmpp-stanzas unexpected-request"`
}

ErrorUnexpectedRequest reflects an unexpected request stanza

type Extension

type Extension Any

Extension represents any XML node not included in the Stanza definition

func (*Extension) GoString

func (e *Extension) GoString() string

GoString implements the GoStringer interface

type Extensions

type Extensions []*Extension

Extensions implements generic XEPs.

func (*Extensions) GoString

func (e *Extensions) GoString() string

GoString implements the GoStringer interface

type FailureTLS

type FailureTLS struct {
	XMLName xml.Name `xml:"urn:ietf:params:xml:ns:xmpp-tls failure"`
}

FailureTLS represents a TLS failure

type FeatureNegotation added in v0.3.9

type FeatureNegotation struct {
	XMLName xml.Name `xml:"http://jabber.org/protocol/feature-neg feature"`
	Form    Form
}

FeatureNegotation is a data element from http://xmpp.org/extensions/xep-0020.html.

type File added in v0.3.9

type File struct {
	XMLName xml.Name   `xml:"http://jabber.org/protocol/si/profile/file-transfer file"`
	Date    string     `xml:"date,attr,omitempty"`
	Hash    string     `xml:"hash,attr,omitempty"`
	Name    string     `xml:"name,attr,omitempty"`
	Size    int64      `xml:"size,attr,omitempty"`
	Desc    string     `xml:"desc,omitempty"`
	Range   *FileRange `xml:",omitempty"`
}

File is a data element from http://xmpp.org/extensions/xep-0096.html.

type FileRange added in v0.3.9

type FileRange struct {
	XMLName xml.Name `xml:"http://jabber.org/protocol/si/profile/file-transfer range"`
	Length  *int     `xml:"length,attr,omitempty"`
	Offset  *int     `xml:"offset,attr,omitempty"`
}

FileRange is a data element from http://xmpp.org/extensions/xep-0096.html.

type FixedFormField

type FixedFormField struct {
	FormField

	Text string
}

FixedFormField is used to indicate a section heading. It's for the form to send data to the user rather than the other way around.

type Form

type Form struct {
	XMLName      xml.Name     `xml:"jabber:x:data x"`
	Type         string       `xml:"type,attr"`
	Title        string       `xml:"title,omitempty"`
	Instructions string       `xml:"instructions,omitempty"`
	Fields       []FormFieldX `xml:"field"`
}

Form contains the definition for a data submission

type FormCallback

type FormCallback func(title, instructions string, fields []interface{}) error

FormCallback is the type of a function called to process a form. The argument is a list of pointers to FormField types. The function should type cast the elements, prompt the user and fill in the result field in each struct.

type FormField

type FormField struct {
	// Label is a human readable label for this field.
	Label string
	// Type is the XMPP-internal type of this field. One should type cast
	// rather than inspect this.
	Type string
	// Name gives the internal name of the field.
	Name string
	// Required specifies is the field is required.
	Required bool
	// Media contains one of more items of media associated with this
	// field and, for each item, one or more representations of it.
	Media [][]Media
}

FormField is the type of a generic form field. One should type cast to a specific type of field before processing.

type FormFieldMediaX

type FormFieldMediaX struct {
	XMLName xml.Name    `xml:"urn:xmpp:media-element media"`
	URIs    []MediaURIX `xml:"uri"`
}

FormFieldMediaX contains form field media information

type FormFieldOptionX

type FormFieldOptionX struct {
	Label string `xml:"var,attr,omitempty"`
	Value string `xml:"value"`
}

FormFieldOptionX contains a form field option

type FormFieldRequiredX

type FormFieldRequiredX struct {
	XMLName xml.Name `xml:"required"`
}

FormFieldRequiredX contains information about whether a form field is required

type FormFieldX

type FormFieldX struct {
	XMLName  xml.Name            `xml:"field"`
	Desc     string              `xml:"desc,omitempty"`
	Var      string              `xml:"var,attr"`
	Type     string              `xml:"type,attr,omitempty"`
	Label    string              `xml:"label,attr,omitempty"`
	Required *FormFieldRequiredX `xml:"required"`
	Values   []string            `xml:"value"`
	Options  []FormFieldOptionX  `xml:"option"`
	Media    []FormFieldMediaX   `xml:"media"`
}

FormFieldX contains form field information

type Hash added in v0.3.9

type Hash struct {
	XMLName   xml.Name `xml:"urn:xmpp:hashes:2 hash"`
	Algorithm string   `xml:"algo,attr"`
	Base64    string   `xml:",chardata"`
}

Hash is a data element from http://xmpp.org/extensions/xep-0300.html.

type HashUsed added in v0.3.9

type HashUsed struct {
	XMLName   xml.Name `xml:"urn:xmpp:hashes:2 hash-used"`
	Algorithm string   `xml:"algo,attr"`
}

HashUsed is a data element from http://xmpp.org/extensions/xep-0300.html.

type IBBClose added in v0.3.9

type IBBClose struct {
	XMLName xml.Name `xml:"http://jabber.org/protocol/ibb close"`
	Sid     string   `xml:"sid,attr"`
}

IBBClose is an element from http://xmpp.org/extensions/xep-0047.html.

type IBBData added in v0.3.9

type IBBData struct {
	XMLName  xml.Name `xml:"http://jabber.org/protocol/ibb data"`
	Sid      string   `xml:"sid,attr"`
	Sequence uint16   `xml:"seq,attr"`
	Base64   string   `xml:",chardata"`
}

IBBData is an element from http://xmpp.org/extensions/xep-0047.html.

type IBBOpen added in v0.3.9

type IBBOpen struct {
	XMLName   xml.Name `xml:"http://jabber.org/protocol/ibb open"`
	BlockSize int      `xml:"block-size,attr"`
	Sid       string   `xml:"sid,attr"`
	Stanza    string   `xml:"stanza,attr,omitempty"`
}

IBBOpen is an element from http://xmpp.org/extensions/xep-0047.html.

type InBandRegistration

type InBandRegistration struct {
	XMLName xml.Name `xml:"http://jabber.org/features/iq-register register,omitempty"`
}

InBandRegistration represents an inband registration

type MACKeyParameter

type MACKeyParameter struct {
	XMLName xml.Name `xml:"http://jabber.org/protocol/si/profile/encrypted-data-transfer mac-key"`
	Type    string   `xml:"type,attr"` // 'static' or 'external'
	Value   string   `xml:"value,attr,omitempty"`
}

MACKeyParameter is an element from an unpublished potential XEP

type MUC

type MUC struct {
	XMLName  xml.Name `xml:"http://jabber.org/protocol/muc x"`
	Password string   `xml:"password,omitempty"`
}

MUC contains information related with Presence x tag

type MUCAdmin

type MUCAdmin struct {
	XMLName xml.Name `xml:"http://jabber.org/protocol/muc#admin query"`
	Item    *MUCItem `xml:"item,omitempty"`
}

MUCAdmin contains the deserialized information about a query tag with muc#admin name space

type MUCConflict

type MUCConflict struct {
	XMLName xml.Name `xml:"urn:ietf:params:xml:ns:xmpp-stanzas conflict,omitempty"`
}

MUCConflict inform user that his or her desired room nickname is in use or registered by another user

type MUCForbidden

type MUCForbidden struct {
	XMLName xml.Name `xml:"urn:ietf:params:xml:ns:xmpp-stanzas forbidden,omitempty"`
}

MUCForbidden inform user that he or she is banned from the room

type MUCItem

type MUCItem struct {
	Name        string `xml:"name,attr,omitempty"`
	Affiliation string `xml:"affiliation,attr,omitempty"`
	Jid         string `xml:"jid,attr,omitempty"`
	Role        string `xml:"role,attr,omitempty"`
	Nick        string `xml:"nick,attr,omitempty"`
	Reason      string `xml:"reason,omitempty"`
}

MUCItem contains the definition for an item tag

type MUCItemActor

type MUCItemActor struct {
	Nickname string `xml:"nick,attr,omitempty"`
}

MUCItemActor contains information related to actor tag

type MUCItemNotFound

type MUCItemNotFound struct {
	XMLName xml.Name `xml:"urn:ietf:params:xml:ns:xmpp-stanzas item-not-found,omitempty"`
}

MUCItemNotFound inform user that the room does not exist

type MUCNotAcceptable

type MUCNotAcceptable struct {
	XMLName xml.Name `xml:"urn:ietf:params:xml:ns:xmpp-stanzas not-acceptable,omitempty"`
}

MUCNotAcceptable inform user that the reserved roomnick must be used

type MUCNotAllowed

type MUCNotAllowed struct {
	XMLName xml.Name `xml:"urn:ietf:params:xml:ns:xmpp-stanzas not-allowed,omitempty"`
}

MUCNotAllowed inform user that room creation is restricted

type MUCNotAuthorized

type MUCNotAuthorized struct {
	XMLName xml.Name `xml:"urn:ietf:params:xml:ns:xmpp-stanzas not-authorized,omitempty"`
}

MUCNotAuthorized inform user that a password is required

type MUCRegistrationRequired

type MUCRegistrationRequired struct {
	XMLName xml.Name `xml:"urn:ietf:params:xml:ns:xmpp-stanzas registration-required,omitempty"`
}

MUCRegistrationRequired inform user that he or she is not on the member list

type MUCRoomConfiguration

type MUCRoomConfiguration struct {
	XMLName xml.Name `xml:"http://jabber.org/protocol/muc#owner query"`
	Form    *Form    `xml:",omitempty"`
}

MUCRoomConfiguration contains the deserialized information about a room configuration query

type MUCRoomDestroy

type MUCRoomDestroy struct {
	Jid      string `xml:"jid,attr,omitempty"`
	Reason   string `xml:"reason,omitempty"`
	Password string `xml:"password,omitempty"`
}

MUCRoomDestroy contains information used to destroy a room

type MUCRoomDestroyQuery

type MUCRoomDestroyQuery struct {
	XMLName xml.Name       `xml:"http://jabber.org/protocol/muc#owner query"`
	Destroy MUCRoomDestroy `xml:"destroy"`
}

MUCRoomDestroyQuery contains query information to destroy a room

type MUCServiceUnavailable

type MUCServiceUnavailable struct {
	XMLName xml.Name `xml:"urn:ietf:params:xml:ns:xmpp-stanzas service-unavailable,omitempty"`
}

MUCServiceUnavailable inform user that the maximum number of users has been reached

type MUCStatus

type MUCStatus struct {
	XMLName xml.Name `xml:"http://jabber.org/protocol/muc status"`
	Code    string   `xml:"code,attr,omitempty"`
}

MUCStatus contains information related to status of the presence or message

type MUCUser

type MUCUser struct {
	XMLName xml.Name        `xml:"http://jabber.org/protocol/muc#user x"`
	Item    *MUCUserItem    `xml:"item,omitempty"`
	Destroy *MUCRoomDestroy `xml:"destroy,omitempty"`
	Status  []MUCUserStatus `xml:"status,omitempty"`
}

MUCUser contains information related to extended presence information about roles and affiliation

type MUCUserItem

type MUCUserItem struct {
	XMLName     xml.Name      `xml:"http://jabber.org/protocol/muc#user item"`
	Role        string        `xml:"role,attr,omitempty"` //moderator, participant, visitor
	Jid         string        `xml:"jid,attr,omitempty"`
	Affiliation string        `xml:"affiliation,attr,omitempty"` //owner, admin, member, none
	Actor       *MUCItemActor `xml:"actor,omitempty"`
	Reason      string        `xml:"reason,omitempty"`
}

MUCUserItem contains information related to role and affiliation

type MUCUserStatus

type MUCUserStatus struct {
	XMLName xml.Name `xml:"http://jabber.org/protocol/muc#user status"`
	Code    int      `xml:"code,attr,omitempty"`
}

MUCUserStatus contains information related to status of the occupant

type Media

type Media struct {
	MIMEType string
	// URI contains a URI to the data. It may be empty if Data is not.
	URI string
	// Data contains the raw data itself. It may be empty if URI is not.
	Data []byte
}

Media contains a specific media uri and data

type MediaURIX

type MediaURIX struct {
	XMLName  xml.Name `xml:"urn:xmpp:media-element uri"`
	MIMEType string   `xml:"type,attr,omitempty"`
	URI      string   `xml:",chardata"`
}

MediaURIX contains information about a Media URI

type Message

type Message struct {
	XMLName xml.Name `xml:"jabber:client message"`
	From    string   `xml:"from,attr"`
	ID      string   `xml:"id,attr"`
	To      string   `xml:"to,attr"`
	Type    string   `xml:"type,attr"`
	Body    string   `xml:"body"`
}

Message structure used to send live messages

type MultiSelectionFormField

type MultiSelectionFormField struct {
	FormField

	Values  []string
	Ids     []string
	Results []int
}

MultiSelectionFormField asks the user to pick a subset of possible choices. The Result member should be set to a series of indexes of the Results array.

type MultiTextFormField

type MultiTextFormField struct {
	FormField

	Defaults []string
	Results  []string
}

MultiTextFormField is for the entry of a several textual items. The Results member should be set to the data entered.

type PingRequest

type PingRequest struct {
	XMLName xml.Name `xml:"urn:xmpp:ping ping"`
}

PingRequest represents a Ping IQ as defined by XEP-0199

type ProceedTLS

type ProceedTLS struct {
	XMLName xml.Name `xml:"urn:ietf:params:xml:ns:xmpp-tls proceed"`
}

ProceedTLS represents a TLS proceed

type RegisterQuery

type RegisterQuery struct {
	XMLName  xml.Name  `xml:"jabber:iq:register query"`
	Username *xml.Name `xml:"username"`
	Password *xml.Name `xml:"password"`
	Form     Form      `xml:"x"`
	Datas    []BobData `xml:"data"`
}

RegisterQuery contains register query information for creating a new account

type ResultFirst added in v0.3.9

type ResultFirst struct {
	XMLName xml.Name `xml:"http://jabber.org/protocol/rsm first"`
	Index   string   `xml:"index,attr,omitempty"`
	Data    string   `xml:",cdata"`
}

ResultFirst is a data element from http://xmpp.org/extensions/xep-0059.html.

type ResultSet added in v0.3.9

type ResultSet struct {
	XMLName xml.Name    `xml:"http://jabber.org/protocol/rsm set"`
	Max     int         `xml:"max,omitempty"`
	Count   int         `xml:"count,omitempty"`
	Index   int         `xml:"index,omitempty"`
	After   string      `xml:"after,omitempty"`
	Before  string      `xml:"before,omitempty"`
	Last    string      `xml:"last,omitempty"`
	First   ResultFirst `xml:"first,omitempty"`
}

ResultSet is a data element from http://xmpp.org/extensions/xep-0059.html.

type Roster

type Roster struct {
	XMLName xml.Name      `xml:"jabber:iq:roster query"`
	Item    []RosterEntry `xml:"item"`
}

Roster contains a list of roster entries

type RosterEntry

type RosterEntry struct {
	Jid          string   `xml:"jid,attr"`
	Subscription string   `xml:"subscription,attr"`
	Name         string   `xml:"name,attr"`
	Group        []string `xml:"group"`
	Ask          string   `xml:"ask,attr"`
}

RosterEntry contains one roster entry

func ParseRoster

func ParseRoster(reply Stanza) ([]RosterEntry, error)

ParseRoster extracts roster information from the given Stanza.

type RosterRequest

type RosterRequest struct {
	XMLName xml.Name          `xml:"jabber:iq:roster query"`
	Item    RosterRequestItem `xml:"item"`
}

RosterRequest is used to request that the server update the user's roster. See RFC 6121, section 2.3.

type RosterRequestItem

type RosterRequestItem struct {
	Jid          string   `xml:"jid,attr"`
	Subscription string   `xml:"subscription,attr"`
	Name         string   `xml:"name,attr"`
	Group        []string `xml:"group"`
}

RosterRequestItem contains one specific entry

type SASLErrorCondition

type SASLErrorCondition string

SASLErrorCondition represents a defined SASL-related error conditions as defined in RFC 6120, section 6.5

const (
	SASLAborted              SASLErrorCondition = "aborted"
	SASLAccountDisabled      SASLErrorCondition = "account-disabled"
	SASLCredentialsExpired   SASLErrorCondition = "credentials-expired"
	SASLEncryptionRequired   SASLErrorCondition = "encryption-required"
	SASLIncorrectEncoding    SASLErrorCondition = "incorrect-encoding"
	SASLInvalidAuthzid       SASLErrorCondition = "invalid-authzid"
	SASLInvalidMechanism     SASLErrorCondition = "invalid-mechanism"
	SASLMalformedRequest     SASLErrorCondition = "malformed-request"
	SASLMechanismTooWeak     SASLErrorCondition = "mechanism-too-weak"
	SASLNotAuthorized        SASLErrorCondition = "not-authorized"
	SASLTemporaryAuthFailure SASLErrorCondition = "temporary-auth-failure"
)

SASL error conditions as defined in RFC 6120, section 6.5

type SI added in v0.3.9

type SI struct {
	XMLName       xml.Name       `xml:"http://jabber.org/protocol/si si"`
	ID            string         `xml:"id,attr,omitempty"`
	MIMEType      string         `xml:"mime-type,attr,omitempty"`
	Profile       string         `xml:"profile,attr,omitempty"`
	Any           *Any           `xml:",any,omitempty"`
	File          *File          `xml:",omitempty"`
	EncryptedData *EncryptedData `xml:",omitempty"`
	Feature       FeatureNegotation
}

SI is a data element from http://xmpp.org/extensions/xep-0095.html.

type SaslAbort

type SaslAbort struct {
	XMLName xml.Name `xml:"urn:ietf:params:xml:ns:xmpp-sasl abort"`
}

SaslAbort signifies a SASL abort

type SaslFailure

type SaslFailure struct {
	XMLName          xml.Name `xml:"urn:ietf:params:xml:ns:xmpp-sasl failure"`
	Text             string   `xml:"text,omitempty"`
	DefinedCondition Any      `xml:",any"`
}

SaslFailure signifies a SASL Failure

func (SaslFailure) Condition

func (f SaslFailure) Condition() SASLErrorCondition

Condition returns a SASL-related error condition

func (SaslFailure) String

func (f SaslFailure) String() string

type SaslMechanisms

type SaslMechanisms struct {
	XMLName   xml.Name `xml:"urn:ietf:params:xml:ns:xmpp-sasl mechanisms"`
	Mechanism []string `xml:"mechanism"`
}

SaslMechanisms contains information about SASL mechanisms RFC 3920 C.4 SASL name space TODO RFC 6120 obsoletes RFC 3920

type SaslSuccess

type SaslSuccess struct {
	XMLName xml.Name `xml:"urn:ietf:params:xml:ns:xmpp-sasl success"`
	Content []byte   `xml:",innerxml"`
}

SaslSuccess signifies a SASL Success

type SelectionFormField

type SelectionFormField struct {
	FormField

	Values []string
	Ids    []string
	Result int
}

SelectionFormField asks the user to pick a single element from a set of choices. The Result member should be set to an index of the Values array.

type Stanza

type Stanza struct {
	Name  xml.Name
	Value interface{}
}

Stanza represents a message from the XMPP server.

type StanzaError

type StanzaError struct {
	By   string `xml:"by,attr"`
	Code string `xml:"code,attr"` // NOTE: I could not find this in the spec

	// cancel -- do not retry (the error is unrecoverable)
	// continue -- proceed (the condition was only a warning)
	// modify -- retry after changing the data sent
	// auth -- retry after providing credentials
	// wait -- retry after waiting (the error is temporary)
	Type string `xml:"type,attr"`
	Text string `xml:"urn:ietf:params:xml:ns:xmpp-stanzas text"`

	//TODO: Replace references by a function call
	Condition struct {
		XMLName xml.Name
		Body    string `xml:",innerxml"`
	} `xml:",any"`

	ApplicationCondition *Any `xml:",any,omitempty"`

	MUCNotAuthorized        *MUCNotAuthorized
	MUCForbidden            *MUCForbidden
	MUCItemNotFound         *MUCItemNotFound
	MUCNotAllowed           *MUCNotAllowed
	MUCNotAcceptable        *MUCNotAcceptable
	MUCRegistrationRequired *MUCRegistrationRequired
	MUCConflict             *MUCConflict
	MUCServiceUnavailable   *MUCServiceUnavailable
}

StanzaError implements RFC 3920, section 9.3. TODO RFC 6120 obsoletes RFC 3920, section "8.3.2. Syntax"

func (*StanzaError) AnyMUCError

func (e *StanzaError) AnyMUCError() interface{}

AnyMUCError will return any of the potential MUC errors, or nil

type StartTLS

type StartTLS struct {
	XMLName  xml.Name `xml:"urn:ietf:params:xml:ns:xmpp-tls starttls"`
	Required xml.Name `xml:"required"`
}

StartTLS represents a TLS start RFC 6120, section 5

type StreamClose

type StreamClose struct{}

StreamClose represents a request to close the stream

type StreamError

type StreamError struct {
	XMLName              xml.Name `xml:"http://etherx.jabber.org/streams error"`
	Text                 string   `xml:"text,omitempty"`
	AppSpecificCondition *Any     `xml:",any,omitempty"`

	DefinedCondition StreamErrorCondition
}

StreamError represents an XMPP Stream Error as defined in RFC 6120, section 4.9

func (*StreamError) String

func (s *StreamError) String() string

type StreamErrorCondition

type StreamErrorCondition string

StreamErrorCondition represents a defined stream error condition as defined in RFC 6120, section 4.9.3

const (
	BadFormat              StreamErrorCondition = "bad-format"
	BadNamespacePrefix     StreamErrorCondition = "bad-namespace-prefix"
	Conflict               StreamErrorCondition = "conflict"
	ConnectionTimeout      StreamErrorCondition = "connection-timeout"
	HostGone               StreamErrorCondition = "host-gone"
	HostUnknown            StreamErrorCondition = "host-unknown"
	ImproperAddressing     StreamErrorCondition = "improper-addressing"
	InternalServerError    StreamErrorCondition = "internal-server-error"
	InvalidFrom            StreamErrorCondition = "invalid-from"
	InvalidNamespace       StreamErrorCondition = "invalid-namespace"
	InvalidXML             StreamErrorCondition = "invalid-xml"
	NotAuthorized          StreamErrorCondition = "not-authorized"
	NotWellFormed          StreamErrorCondition = "not-well-formed"
	PolicyViolation        StreamErrorCondition = "policy-violation"
	RemoteConnectionFailed StreamErrorCondition = "remote-connection-failed"
	Reset                  StreamErrorCondition = "reset"
	ResourceConstraint     StreamErrorCondition = "resource-constraint"
	RestrictedXML          StreamErrorCondition = "restricted-xml"
	SeeOtherHost           StreamErrorCondition = "see-other-host"
	SystemShutdown         StreamErrorCondition = "system-shutdown"
	UndefinedCondition     StreamErrorCondition = "undefined-condition"
	UnsupportedEncoding    StreamErrorCondition = "unsupported-encoding"
	UnsupportedFeature     StreamErrorCondition = "unsupported-feature"
	UnsupportedStanzaType  StreamErrorCondition = "unsupported-stanza-type"
	UnsupportedVersion     StreamErrorCondition = "unsupported-version"
)

Stream error conditions as defined in RFC 6120, section 4.9.3

func (StreamErrorCondition) MarshalXML

func (c StreamErrorCondition) MarshalXML(e *xml.Encoder, start xml.StartElement) error

MarshalXML implements xml.Marshaler interface

type StreamFeatures

type StreamFeatures struct {
	XMLName            xml.Name `xml:"http://etherx.jabber.org/streams features"`
	StartTLS           StartTLS
	Mechanisms         SaslMechanisms
	Bind               BindBind
	InBandRegistration *InBandRegistration

	// This is a hack for now to get around the fact that the new encoding/xml
	// doesn't unmarshal to XMLName elements.
	Session *string `xml:"session"`
}

StreamFeatures contain information about the features this stream supports RFC 3920 C.1 Streams name space TODO RFC 6120 obsoletes RFC 3920

type Subject

type Subject struct {
	XMLName xml.Name `xml:"subject"`
	Text    string   `xml:",innerxml"`
}

Subject contains all the subject text of any room when it is received

type TextFormField

type TextFormField struct {
	FormField

	Default string
	Result  string

	// Private is true if this is a password or other sensitive entry.
	Private bool
}

TextFormField is for the entry of a single textual item. The Result member should be set to the data entered.

type VCard added in v0.3.6

type VCard struct {
	XMLName xml.Name `xml:"vcard-temp vCard"`

	FullName string `xml:"FN"`
	Nickname string `xml:"NICKNAME"`
}

VCard contains vcard

func ParseVCard added in v0.3.6

func ParseVCard(reply Stanza) (VCard, error)

ParseVCard extracts vcard information from the given Stanza.

type VersionQuery

type VersionQuery struct {
	XMLName xml.Name `xml:"jabber:iq:version query"`
}

VersionQuery represents a version query

type VersionReply

type VersionReply struct {
	XMLName xml.Name `xml:"jabber:iq:version query"`
	Name    string   `xml:"name"`
	Version string   `xml:"version"`
	OS      string   `xml:"os"`
}

VersionReply contains a version reply

Jump to

Keyboard shortcuts

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