oob

package
v0.21.4 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2023 License: BSD-2-Clause Imports: 4 Imported by: 3

Documentation

Overview

Package oob implements XEP-0066: Out of Band Data.

Index

Constants

View Source
const (
	NS      = `jabber:x:oob`
	NSQuery = `jabber:iq:oob`
)

OOB namespaces provided as a convenience.

Variables

View Source
var (
	Feature   = info.Feature{Var: NS}
	FeatureIQ = info.Feature{Var: NS}
)

A list of service discovery features that are supported by this package.

Functions

This section is empty.

Types

type Data

type Data struct {
	XMLName xml.Name `xml:"jabber:x:oob x"`
	URL     string   `xml:"url"`
	Desc    string   `xml:"desc,omitempty"`
}

Data represents an OOB data node that might be placed in a message or presence stanza.

func (Data) TokenReader added in v0.18.0

func (d Data) TokenReader() xml.TokenReader

TokenReader satisfies the xmlstream.Marshaler interface.

func (Data) WriteXML added in v0.18.0

func (d Data) WriteXML(w xmlstream.TokenWriter) (int, error)

WriteXML satisfies the xmlstream.WriterTo interface. It is like MarshalXML except it writes tokens to w.

type IQ

type IQ struct {
	stanza.IQ
	Query Query
}

IQ represents an OOB data query; for instance:

<iq type='set'
    from='feste@example.net/asegasd'
    to='malvolio@jabber.org/apkjase'
    id='asiepjg'>
  <query xmlns='jabber:iq:oob'>
    <url>https://xmpp.org/images/promo/xmpp_server_guide_2017.pdf</url>
    <desc>XMPP Server Setup Guide 2017</desc>
  </query>
</iq>

func (IQ) TokenReader added in v0.18.0

func (iq IQ) TokenReader() xml.TokenReader

TokenReader satisfies the xmlstream.Marshaler interface.

func (IQ) WriteXML added in v0.18.0

func (iq IQ) WriteXML(w xmlstream.TokenWriter) (int, error)

WriteXML satisfies the xmlstream.WriterTo interface. It is like MarshalXML except it writes tokens to w.

type Query

type Query struct {
	XMLName xml.Name `xml:"jabber:iq:oob query"`
	URL     string   `xml:"url"`
	Desc    string   `xml:"desc,omitempty"`
}

Query represents an OOB data node that might be placed in an IQ stanza.

func (Query) TokenReader added in v0.18.0

func (q Query) TokenReader() xml.TokenReader

TokenReader satisfies the xmlstream.Marshaler interface.

func (Query) WriteXML added in v0.18.0

func (q Query) WriteXML(w xmlstream.TokenWriter) (int, error)

WriteXML satisfies the xmlstream.WriterTo interface. It is like MarshalXML except it writes tokens to w.

Jump to

Keyboard shortcuts

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