如何使用Go创建帐户并在ejabberd中添加/删除朋友?

I found this library: golang xmpp, and it is quite low level (exposed the details of xmpp protocol).I took some time to dig into it, but quite time consuming. Since,right now,I just need three functions:

  1. create account
  2. add friend(I think it should be divided into send request/approve request)
  3. remove friend

So, can anybody tell me how to do it in this library?

I assume you want to manage an XMPP server from you backend. I would not use an XMPP bot to perform those task.

You should consider using ejabberd XMLRPC API to perform those tasks. All commands available from ejabberdctl are exposed. It means that you can control a lot of ejabberd behaviour using that API.