xmpp

package module
v0.0.0-...-7eb5d47 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2018 License: MIT Imports: 15 Imported by: 6

Documentation

Index

Constants

View Source
const (
	PLAIN             = "PLAIN"
	BINARY_SALS       = "\x00"
	XML_STREAM        = "http://etherx.jabber.org/streams"
	XML_CLIENT        = "jabber:client"
	XML_TLS           = "urn:ietf:params:xml:ns:xmpp-tls"
	VERSION           = "1.0"
	XMPP_DEFAULT_PORT = ":5222"
	STREAM            = "stream"
)
View Source
const (
	JABBER_IQ_ROSTER = "jabber:iq:roster"
	JABBER_IQ_DOCKER = "jabber:iq:docker"
	DISCO_ITEMS      = "http://jabber.org/protocol/disco#items"
	MUC_ONLINE       = "muc_online"
	MUC_OFFLINE      = "muc_offline"

	PRESENCE_HANDLER = "PRESENCE"
	MESSAGE_HANDLER  = "MESSAGE"
	IQ_HANDLER       = "IQ"
)
View Source
const (
	FORM_CREATE_ROOM = "" /* 1825-byte string literal not displayed */
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	sync.RWMutex

	Jid  string
	User string
	// contains filtered or unexported fields
}

func NewClient

func NewClient(o Options) (*Client, error)

func (*Client) CreateRoom

func (c *Client) CreateRoom(name string) error

func (*Client) DiscoItems

func (c *Client) DiscoItems(to string) error

XEP-0030: Service Discovery

func (*Client) MucPresence

func (c *Client) MucPresence(room string) error

func (*Client) Receiver

func (c *Client) Receiver(ctx context.Context)

func (*Client) RegisterHandler

func (c *Client) RegisterHandler(plugin string, f func(interface{}))

func (*Client) Roster

func (c *Client) Roster() error

func (*Client) Send

func (c *Client) Send(i interface{}) error

func (*Client) SendPresenceMuc

func (c *Client) SendPresenceMuc(to string) error

type ClientIQ

type ClientIQ struct {
	XMLName xml.Name `xml:"jabber:client iq"`
	From    string   `xml:"from,attr"`
	ID      string   `xml:"id,attr"`
	To      string   `xml:"to,attr"`
	Type    string   `xml:"type,attr"` // error, get, result, set
	Query   []byte   `xml:",innerxml"`
	Error   *IQError
	Bind    bindBind
}
type Cookie uint64

type IQ

type IQ struct {
	XMLName xml.Name `xml:"iq"`
	From    string   `xml:"from,attr,omitempty"`
	To      string   `xml:"to,attr,omitempty"`
	Type    string   `xml:"type,attr,omitempty"`
	ID      string   `xml:"id,attr,omitempty"`
	Query   []byte   `xml:"query,omitempty"`
}

type IQError

type IQError struct {
	XMLName xml.Name `xml:"jabber:client error"`
	Code    string   `xml:"code,attr,omitempty"`
	Type    string   `xml:"type,attr,omitempty"`
	Text    string   `xml:"text,omitempty"`
}

type Message

type Message struct {
	XMLName xml.Name `xml:"message"`
	XMLNSGA string   `xml:"xmlns:ga,attr,omitempty"`
	To      string   `xml:"to,attr,omitempty"`
	From    string   `xml:"from,attr,omitempty"`
	Type    string   `xml:"type,attr,omitempty"`
	ID      string   `xml:"id,attr,omitempty"`
	Subject string   `xml:"subject,omitempty"`
	Body    string   `xml:"body,omitempty"`
}

type Minions

type Minions struct {
	Containers []string
}

type MucUser

type MucUser struct {
	XMLName xml.Name       `xml:"http://jabber.org/protocol/muc#user x"`
	Item    []itemPresence `xml:"item"`
}

type Options

type Options struct {
	Host      string
	Port      string
	User      string
	Password  string
	Mechanism string
}

type Presence

type Presence struct {
	XMLName xml.Name `xml:"jabber:client presence"`
	From    string   `xml:"from,attr,omitempty"`
	ID      string   `xml:"id,attr,omitempty"`
	To      string   `xml:"to,attr,omitempty"`
	Type    string   `xml:"type,attr,omitempty"` // error, probe, subscribe, subscribed, unavailable, unsubscribe, unsubscribed
	Lang    string   `xml:"lang,attr,omitempty"`

	Show     string `xml:"show,omitempty"`   // away, chat, dnd, xa
	Status   string `xml:"status,omitempty"` // sb []clientText
	Priority string `xml:"priority,attr,omitempty"`
	Error    *clientError
	User     MucUser
}

type Query

type Query struct {
	XMLName xml.Name
}

type QueryDiscoItems

type QueryDiscoItems struct {
	XMLName xml.Name     `xml:"http://jabber.org/protocol/disco#items query"`
	Item    []RosterItem `xml:"item"`
}

type QueryRoster

type QueryRoster struct {
	XMLName xml.Name     `xml:"jabber:iq:roster query"`
	Item    []RosterItem `xml:"item"`
}

type RosterItem

type RosterItem struct {
	Jid          string   `xml:"jid,attr,omitempty"`
	Subscription string   `xml:"subscription,attr,omitempty"`
	Name         string   `xml:"name,attr,omitempty"`
	Group        []string `xml:"group,omitempty"`
}

type Stream

type Stream struct {
	XMLName     xml.Name `xml:"stream:stream"`
	XMLNS       string   `xml:"xmlns,attr,omitempty"`
	XMLNSStream string   `xml:"xmlns:stream,attr,omitempty"`
	Language    string   `xml:"xml:lang,attr,omitempty"`
	To          string   `xml:"to,attr,omitempty"`
	From        string   `xml:"from,attr,omitempty"`
	ID          string   `xml:"id,attr,omitempty"`
	Version     string   `xml:"version,attr,omitempty"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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