Versions in this module Expand all Collapse all v0 v0.2.0 Oct 7, 2017 Changes in this version type Conn + func (c *Conn) Close() error + func (c *Conn) ConnectionState() (connState tls.ConnectionState, ok bool) + func (c *Conn) LocalAddr() net.Addr + func (c *Conn) Read(b []byte) (n int, err error) + func (c *Conn) RemoteAddr() net.Addr + func (c *Conn) SetDeadline(t time.Time) error + func (c *Conn) SetReadDeadline(t time.Time) error + func (c *Conn) SetWriteDeadline(t time.Time) error + func (c *Conn) Write(b []byte) (int, error) type Session + func NewClientSession(ctx context.Context, origin *jid.JID, lang string, rw io.ReadWriter, ...) (*Session, error) + func NewServerSession(ctx context.Context, location, origin *jid.JID, lang string, rw io.ReadWriter, ...) (*Session, error) + func (s *Session) EncodeToken(t xml.Token) error + func (s *Session) Flush() error v0.1.0 Oct 2, 2017 Changes in this version type Session + func (s *Session) Token() (xml.Token, error) v0.0.1 Sep 24, 2017 Changes in this version + var ErrTLSUpgradeFailed = errors.New("The underlying connection cannot be upgraded to TLS") + type Config struct + Features map[xml.Name]StreamFeature + Identity string + Lang language.Tag + Location *jid.JID + Origin *jid.JID + Password string + S2S bool + TLSConfig *tls.Config + Version internal.Version + func NewClientConfig(origin *jid.JID, features ...StreamFeature) (c *Config) + func NewServerConfig(location, origin *jid.JID, features ...StreamFeature) (c *Config) + type Conn net.Conn + func DialClient(ctx context.Context, network string, addr *jid.JID) (Conn, error) + func DialServer(ctx context.Context, network string, addr *jid.JID) (Conn, error) + type Dialer struct + NoLookup bool + S2S bool + func (d *Dialer) Dial(ctx context.Context, network string, addr *jid.JID) (Conn, error) + type Handler interface + HandleXMPP func(s *Session, start *xml.StartElement) error + type HandlerFunc func(s *Session, start *xml.StartElement) error + func (f HandlerFunc) HandleXMPP(s *Session, start *xml.StartElement) error + type Negotiator func(ctx context.Context, session *Session, data interface{}) (mask SessionState, rw io.ReadWriter, cache interface{}, err error) + type Session struct + func NegotiateSession(ctx context.Context, config *Config, rw io.ReadWriter, negotiate Negotiator) (*Session, error) + func NewSession(ctx context.Context, config *Config, rw io.ReadWriter) (*Session, error) + func (s *Session) Close() (err error) + func (s *Session) Config() *Config + func (s *Session) Conn() io.ReadWriter + func (s *Session) Encoder() *xml.Encoder + func (s *Session) Feature(namespace string) (data interface{}, ok bool) + func (s *Session) LocalAddr() *jid.JID + func (s *Session) RemoteAddr() *jid.JID + func (s *Session) Serve(handler Handler) error + func (s *Session) State() SessionState + func (s *Session) TokenReader() xmlstream.TokenReader + type SessionState uint8 + const Authn + const InputStreamClosed + const OutputStreamClosed + const Ready + const Received + const Secure + type StreamFeature struct + List func(ctx context.Context, e *xml.Encoder, start xml.StartElement) (req bool, err error) + Name xml.Name + Necessary SessionState + Negotiate func(ctx context.Context, session *Session, data interface{}) (mask SessionState, rw io.ReadWriter, err error) + Parse func(ctx context.Context, r xmlstream.TokenReader, start *xml.StartElement) (req bool, data interface{}, err error) + Prohibited SessionState + func BindCustom(server func(*jid.JID, string) (*jid.JID, error)) StreamFeature + func BindResource() StreamFeature + func SASL(mechanisms ...sasl.Mechanism) StreamFeature + func StartTLS(required bool) StreamFeature