Documentation
¶
Index ¶
- func HandleStanza(handler StanzaHandler, stanza xmpp.Stanza) bool
- func Open(handler Handler, cfg *Config) error
- type Authenticator
- type Broadcast
- type Callbacks
- type Config
- type Conn
- type Credentials
- type DNSResolver
- type Filter
- type Handler
- type IQCallback
- type MessageCallback
- type PlainAuth
- type PresenceCallback
- type ScramAuth
- type Session
- type StanzaHandler
- type UniqueID
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HandleStanza ¶
func HandleStanza(handler StanzaHandler, stanza xmpp.Stanza) bool
HandleStanza routes a stanza to a typed stanza handler
Types ¶
type Authenticator ¶
Authenticator defines an interface for SASL authentication
func NewPlainAuthenticator ¶
func NewPlainAuthenticator(creds Credentials) Authenticator
NewPlainAuthenticator instantiates a PLAIN authenticator using provided credentials
func NewScramSHA1Authenticator ¶
func NewScramSHA1Authenticator(creds Credentials) Authenticator
type Broadcast ¶
type Broadcast struct {
// contains filtered or unexported fields
}
Broadcast routes XMPP events to mutiple handlers
func (*Broadcast) HandleStanza ¶
HandleStanza routes a stanza
type Callbacks ¶
type Callbacks struct { Session // contains filtered or unexported fields }
func (*Callbacks) WriteIQ ¶
func (c *Callbacks) WriteIQ(iq *xmpp.IQ, callback IQCallback) error
func (*Callbacks) WriteMessage ¶
func (c *Callbacks) WriteMessage(msg *xmpp.Message, callback MessageCallback) error
func (*Callbacks) WritePresence ¶
func (c *Callbacks) WritePresence(p *xmpp.Presence, callback PresenceCallback) error
type Conn ¶
type Conn struct {
// contains filtered or unexported fields
}
Conn represents an XMPP connection
func (*Conn) Features ¶
func (c *Conn) Features() *xmpp.Features
Features returns the current stream features
type Credentials ¶
Credentials holds authentication information
type DNSResolver ¶
type DNSResolver struct {
// contains filtered or unexported fields
}
DNSResolver represents a DSN resolver
func NewDNSResolver ¶
func NewDNSResolver(domain string) *DNSResolver
NewDNSResolver returns an instance of a DNSResolver
func (*DNSResolver) ClientAddress ¶
func (r *DNSResolver) ClientAddress() string
ClientAddress resolves the address XMPP clients should connect to
func (*DNSResolver) ServerAddress ¶
func (r *DNSResolver) ServerAddress() string
ServerAddress resolves the address XMPP servers should connect to
type IQCallback ¶
type IQCallback func(*xmpp.IQ)
type MessageCallback ¶
type MessageCallback func(*xmpp.Message)
type PlainAuth ¶
PlainAuth implements a plain SASL authentication
func (*PlainAuth) Challenge ¶
Challenge satisfies Authenticator interface. It returns an empty string since PLAIN mechanism doesn't support challenges.
type PresenceCallback ¶
type PresenceCallback func(*xmpp.Presence)
type StanzaHandler ¶
type StanzaHandler interface{}
StanzaHandler defines an interface for specific stanza handler