Documentation ¶
Overview ¶
Package mux implements an XMPP multiplexer.
Be advised: This package is experimental and likely to change or be removed entirely.
Index ¶
- type Option
- func Handle(n xml.Name, h xmpp.Handler) Option
- func HandleFunc(n xml.Name, h xmpp.HandlerFunc) Option
- func IQ(h xmpp.Handler) Option
- func IQFunc(h xmpp.HandlerFunc) Option
- func Message(h xmpp.Handler) Option
- func MessageFunc(h xmpp.HandlerFunc) Option
- func Presence(h xmpp.Handler) Option
- func PresenceFunc(h xmpp.HandlerFunc) Option
- type ServeMux
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option func(m *ServeMux)
Option configures a ServeMux.
func HandleFunc ¶ added in v0.9.0
func HandleFunc(n xml.Name, h xmpp.HandlerFunc) Option
HandleFunc returns an option that matches on the provided XML name.
func IQFunc ¶ added in v0.10.0
func IQFunc(h xmpp.HandlerFunc) Option
IQFunc returns an option that matches on all IQ stanzas.
func MessageFunc ¶ added in v0.10.0
func MessageFunc(h xmpp.HandlerFunc) Option
MessageFunc returns an option that matches on all message stanzas.
func PresenceFunc ¶ added in v0.10.0
func PresenceFunc(h xmpp.HandlerFunc) Option
PresenceFunc returns an option that matches on all presence stanzas.
type ServeMux ¶
type ServeMux struct {
// contains filtered or unexported fields
}
ServeMux is an XMPP stream multiplexer. It matches the start element token of each top level stream element against a list of registered patterns and calls the handler for the pattern that most closely matches the token.
Patterns are XML names. If either the namespace or the localname is left off, any namespace or localname will be matched. Full XML names take precedence, followed by wildcard namespaces, followed by wildcard localnames.
func (*ServeMux) HandleXMPP ¶
func (m *ServeMux) HandleXMPP(t xmlstream.TokenReadWriter, start *xml.StartElement) error
HandleXMPP dispatches the request to the handler whose pattern most closely matches start.Name.