xmpp

package module
v0.0.0-...-576b704 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 5, 2013 License: BSD-3-Clause Imports: 16 Imported by: 0

Documentation

Overview

Package xmpp implements a simple Google Talk client using the XMPP protocol described in RFC 3920 and RFC 3921.

TODO(flo):

  • support password protected MUC rooms
  • cleanup signatures of join/leave functions

Index

Constants

This section is empty.

Variables

View Source
var DefaultConfig tls.Config

Functions

This section is empty.

Types

type Chat

type Chat struct {
	Remote  string
	Type    string
	Text    string
	Delayed bool
}

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(host, user, passwd string, debug bool) (*Client, error)

NewClient creates a new connection to a host given as "hostname" or "hostname:port". If host is not specified, the DNS SRV should be used to find the host from the domainpart of the JID. Default the port to 5222.

func NewClientNoTLS

func NewClientNoTLS(host, user, passwd string, debug bool) (*Client, error)

func (*Client) Close

func (c *Client) Close() error

func (*Client) JoinMUC

func (c *Client) JoinMUC(jid string)

xep-0045 7.2

func (*Client) LeaveMUC

func (c *Client) LeaveMUC(jid string)

xep-0045 7.14

func (*Client) Recv

func (c *Client) Recv() (event interface{}, err error)

Recv wait next token of chat.

func (*Client) Send

func (c *Client) Send(chat Chat)

Send sends message text.

func (*Client) SendHtml

func (c *Client) SendHtml(chat HtmlChat)

TODO: filter html

type HtmlChat

type HtmlChat struct {
	Remote    string
	Type      string
	PlainText string
	Html      string
}

type Presence

type Presence struct {
	From string
	To   string
	Type string
	Show string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL