xep0199

package
v0.59.0 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2022 License: Apache-2.0 Imports: 14 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 `fig:"ack_timeout" default:"32s"`
	// Interval tells how often pings should be sent to clients.
	Interval time.Duration `fig:"interval" default:"1m"`
	// SendPings tells whether server pings should be sent.
	SendPings bool `fig:"send_pings"`
	// TimeoutAction specifies the action to be taken when a client is considered as disconnected.
	TimeoutAction string `fig:"timeout_action" default:"none"`
}

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(cfg Config, router router.Router, hk *hook.Hooks, logger kitlog.Logger) *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