Adds an example directly in README file to get a feel of the API

This commit is contained in:
Mickael Remond
2019-06-07 16:33:10 +02:00
parent 0865f4e35c
commit 3689448c90
2 changed files with 53 additions and 4 deletions

View File

@@ -1,5 +1,5 @@
/*
xmpp_client is a demo client that connect on an XMPP server and echo message received back to original sender.
xmpp_echo is a demo client that connect on an XMPP server and echo message received back to original sender.
*/
package main
@@ -30,8 +30,6 @@ func main() {
// for you automatically.
cm := xmpp.NewClientManager(client, nil)
err = cm.Start()
// connection can be stopped with cm.Stop()
// connection state can be checked by reading cm.Client.CurrentState
if err != nil {
log.Fatal(err)
}