xep0199

package
v0.0.0-...-aeec266 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2021 License: BSD-3-Clause Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Send         bool
	SendInterval time.Duration
}

Config represents XMPP Ping module (XEP-0199) configuration.

func (*Config) UnmarshalYAML

func (c *Config) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML satisfies Unmarshaler interface.

type Ping

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

Ping represents a ping server stream module.

func New

func New(config *Config, disco *xep0030.DiscoInfo, router router.Router) *Ping

New returns an ping IQ handler module.

func (*Ping) CancelPing

func (x *Ping) CancelPing(stm stream.C2S)

CancelPing cancels a previous scheduled ping.

func (*Ping) MatchesIQ

func (x *Ping) MatchesIQ(iq *xmpp.IQ) bool

MatchesIQ returns whether or not an IQ should be processed by the ping module.

func (*Ping) ProcessIQ

func (x *Ping) ProcessIQ(ctx context.Context, iq *xmpp.IQ)

ProcessIQ processes a ping IQ taking according actions over the associated stream.

func (*Ping) SchedulePing

func (x *Ping) SchedulePing(stm stream.C2S)

SchedulePing schedules a new ping in a 'send interval' period, cancelling previous scheduled ping.

func (*Ping) Shutdown

func (x *Ping) Shutdown() error

Shutdown shuts down ping module.

Jump to

Keyboard shortcuts

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