31 |
31 |
32 // DNS SRV names |
32 // DNS SRV names |
33 serverSrv = "xmpp-server" |
33 serverSrv = "xmpp-server" |
34 clientSrv = "xmpp-client" |
34 clientSrv = "xmpp-client" |
35 |
35 |
36 // TODO Make this a parameter to NewClient, not a |
36 // BUG(cjyar) Make this a parameter to NewClient, not a |
37 // constant. We should have both a log level and a |
37 // constant. We should have both a log level and a |
38 // syslog.Writer, so the app can control how much time we |
38 // syslog.Writer, so the app can control how much time we |
39 // spend generating log messages, as well as where they go. |
39 // spend generating log messages, as well as where they go. |
40 debug = true |
40 debug = true |
41 ) |
41 ) |
56 nextId int64 |
56 nextId int64 |
57 handlers chan *stanzaHandler |
57 handlers chan *stanzaHandler |
58 // Incoming XMPP stanzas from the server will be published on |
58 // Incoming XMPP stanzas from the server will be published on |
59 // this channel. Information which is only used by this |
59 // this channel. Information which is only used by this |
60 // library to set up the XMPP stream will not appear here. |
60 // library to set up the XMPP stream will not appear here. |
61 // TODO Make these channels of type Stanza. |
61 // BUG(cjyar) Make these channels of type Stanza. |
62 In <-chan interface{} |
62 In <-chan interface{} |
63 // Outgoing XMPP stanzas to the server should be sent to this |
63 // Outgoing XMPP stanzas to the server should be sent to this |
64 // channel. |
64 // channel. |
65 Out chan<- interface{} |
65 Out chan<- interface{} |
66 xmlOut chan<- interface{} |
66 xmlOut chan<- interface{} |
67 // TODO Remove this. Make a Stanza parser method available for |
67 // BUG(cjyar) Remove this. Make a Stanza parser method |
68 // use by interact.go and similar applications. |
68 // available for use by interact.go and similar applications. |
69 TextOut chan<- *string |
69 TextOut chan<- *string |
70 } |
70 } |
71 var _ io.Closer = &Client{} |
71 var _ io.Closer = &Client{} |
72 |
72 |
73 // Connect to the appropriate server and authenticate as the given JID |
73 // Connect to the appropriate server and authenticate as the given JID |