xep0198

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: 22 Imported by: 0

Documentation

Index

Constants

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

	// XEPNumber represents stream XEP number.
	XEPNumber = "0198"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// HibernateTime defines defines the amount of time a stream
	// can stay in disconnected state before being terminated.
	HibernateTime time.Duration

	// RequestAckInterval defines the period of stream inactivity
	// that should be waited before requesting acknowledgement.
	RequestAckInterval time.Duration

	// WaitForAckTimeout defines stanza acknowledgement timeout.
	WaitForAckTimeout time.Duration

	// MaxQueueSize defines maximum number of unacknowledged stanzas.
	// When the limit is reached the c2s stream is terminated.
	MaxQueueSize int
}

Config contains stream management module configuration options.

type Stream

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

Stream represents a stream (XEP-0198) module type.

func New

func New(
	router router.Router,
	hosts *host.Hosts,
	resMng *c2s.ResourceManager,
	hk *hook.Hooks,
	cfg Config,
) *Stream

New returns a new initialized Stream instance.

func (*Stream) AccountFeatures

func (m *Stream) AccountFeatures(_ context.Context) ([]string, error)

AccountFeatures returns stream account disco features.

func (*Stream) Name

func (m *Stream) Name() string

Name returns stream module name.

func (*Stream) ServerFeatures

func (m *Stream) ServerFeatures(_ context.Context) ([]string, error)

ServerFeatures returns stream server disco features.

func (*Stream) Start

func (m *Stream) Start(_ context.Context) error

Start starts stream module.

func (*Stream) Stop

func (m *Stream) Stop(_ context.Context) error

Stop stops stream module.

func (*Stream) StreamFeature

func (m *Stream) StreamFeature(_ context.Context, _ string) (stravaganza.Element, error)

StreamFeature returns stream module stream feature.

Jump to

Keyboard shortcuts

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