xep0199

package
v0.52.2 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2021 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 Options added in v0.52.2

type Options 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
}

Options 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, sn *sonar.Sonar, opts Options) *Ping

New returns a new initialized ping instance.

func (*Ping) AccountFeatures added in v0.52.2

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

AccountFeatures returns ping account disco features.

func (*Ping) MatchesNamespace added in v0.52.2

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

MatchesNamespace tells whether namespace matches ping module.

func (*Ping) Name added in v0.52.2

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 added in v0.52.2

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

ServerFeatures returns ping server disco features.

func (*Ping) Start added in v0.52.2

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

Start starts ping module.

func (*Ping) Stop added in v0.52.2

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

Stop stops ping module.

func (*Ping) StreamFeature added in v0.52.2

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