forked from chteufleur/go-xmpp
More useful docs for Stream and XMPP.
This commit is contained in:
parent
6416a5e1ee
commit
ec1eaf94b9
|
|
@ -20,8 +20,8 @@ type Stream struct {
|
|||
dec *xml.Decoder
|
||||
}
|
||||
|
||||
// Create a XML stream connection. Typically handles the encoding and decoding
|
||||
// of XML data for a higher-level API, e.g. XMPP.
|
||||
// Create a XML stream connection. A Steam is used by an XMPP instance to
|
||||
// handle sending and receiving XML data over the net connection.
|
||||
func NewStream(addr string) (*Stream, error) {
|
||||
|
||||
log.Println("Connecting to", addr)
|
||||
|
|
|
|||
|
|
@ -2,7 +2,11 @@ package xmpp
|
|||
|
||||
import "log"
|
||||
|
||||
// Handles XMPP conversations over a Stream. Use NewClientXMPP and/or
|
||||
// NewComponentXMPP to create and configuring a XMPP instance.
|
||||
type XMPP struct {
|
||||
// JID associated with the stream. Note: this may be negotiated with the
|
||||
// server during setup and so must be used for all messages.
|
||||
JID JID
|
||||
stream *Stream
|
||||
in chan interface{}
|
||||
|
|
@ -21,6 +25,7 @@ func newXMPP(jid JID, stream *Stream) *XMPP {
|
|||
return x
|
||||
}
|
||||
|
||||
// Send a stanza.
|
||||
func (x *XMPP) Send(v interface{}) {
|
||||
x.out <- v
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue