xep0199

package
v0.54.1 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2021 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ModuleName represents ping module name.
	ModuleName = "ping"

	// XEPNumber represents ping XEP number.
	XEPNumber = "0199"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// AckTimeout tells how long should we wait until considering a client to be disconnected.
	AckTimeout time.Duration

	// Interval tells how often pings should be sent to clients.
	Interval time.Duration

	// SendPings tells whether or not server pings should be sent.
	SendPings bool

	// TimeoutAction specifies the action to be taken when a client is considered as disconnected.
	TimeoutAction string
}

Config contains ping module configuration options.

type Ping

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

Ping represents ping (XEP-0199) module type.

func New

func New(router router.Router, hk *hook.Hooks, cfg Config) *Ping

New returns a new initialized ping instance.

func (*Ping) AccountFeatures

func (p *Ping) AccountFeatures(_ context.Context) ([]string, error)

AccountFeatures returns ping account disco features.

func (*Ping) MatchesNamespace

func (p *Ping) MatchesNamespace(namespace string, _ bool) bool

MatchesNamespace tells whether namespace matches ping module.

func (*Ping) Name

func (p *Ping) Name() string

Name returns ping module name.

func (*Ping) ProcessIQ

func (p *Ping) ProcessIQ(ctx context.Context, iq *stravaganza.IQ) error

ProcessIQ process a ping iq.

func (*Ping) ServerFeatures

func (p *Ping) ServerFeatures(_ context.Context) ([]string, error)

ServerFeatures returns ping server disco features.

func (*Ping) Start

func (p *Ping) Start(_ context.Context) error

Start starts ping module.

func (*Ping) Stop

func (p *Ping) Stop(_ context.Context) error

Stop stops ping module.

func (*Ping) StreamFeature

func (p *Ping) StreamFeature(_ context.Context, _ string) (stravaganza.Element, error)

StreamFeature returns ping module stream feature.

Jump to

Keyboard shortcuts

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