delay

package
Version: v0.20.0 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2021 License: BSD-2-Clause Imports: 7 Imported by: 0

Documentation

Overview

Package delay implements delayed delivery of stanzas.

Index

Constants

View Source
const NS = "urn:xmpp:delay"

NS is the namespace used by this package.

Variables

This section is empty.

Functions

func Insert

func Insert(d Delay) xmlstream.Transformer

Insert adds a delay into any element read through the transformer at the current nesting level.

func Stanza

func Stanza(d Delay, stanzaNS string) xmlstream.Transformer

Stanza inserts a delay into any stanza read through the stream.

Types

type Delay

type Delay struct {
	XMLName xml.Name  `xml:"urn:xmpp:delay delay"`
	From    jid.JID   `xml:"from,attr,omitempty"`
	Time    time.Time `xml:"stamp,attr"`
	Reason  string    `xml:",chardata"`
}

Delay is a type that can be added to stanzas to indicate that they have been delivered with a delay.

func (Delay) MarshalXML

func (d Delay) MarshalXML(e *xml.Encoder, _ xml.StartElement) error

MarshalXML implements xml.Marshaler.

func (Delay) TokenReader

func (d Delay) TokenReader() xml.TokenReader

TokenReader implements xmlstream.Marshaler.

func (*Delay) UnmarshalXML

func (d *Delay) UnmarshalXML(decoder *xml.Decoder, start xml.StartElement) error

UnmarshalXML implements xml.Unmarshaler.

func (Delay) WriteXML

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

WriteXML implements xmlstream.WriterTo.

Source Files

Jump to

Keyboard shortcuts

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