xmpp

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2020 License: BSD-3-Clause Imports: 15 Imported by: 0

Documentation

Overview

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

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
	Roster   Roster
	Presence *Presence
}

type Client

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

func NewClient

func NewClient(host, user, passwd string) (*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 (*Client) Close

func (c *Client) Close() error

func (*Client) Recv

func (c *Client) Recv() (chat Chat, err error)

Recv wait next token of chat.

func (*Client) Roster

func (c *Client) Roster() error

Roster asks for the chat roster.

func (*Client) Send

func (c *Client) Send(chat Chat) error

Send sends message text.

func (*Client) Status

func (c *Client) Status(status Status, msg string) error

type Contact

type Contact struct {
	Remote string
	Name   string
	Group  []string
}

type Presence

type Presence struct {
	Remote    string
	Status    Status
	StatusMsg string
	Priority  int
}

type Roster

type Roster []Contact

type Status

type Status int
const (
	Unavailable Status = iota
	DoNotDisturb
	ExtendedAway
	Away
	Available
)

func (Status) String

func (s Status) String() string

Jump to

Keyboard shortcuts

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