externalmodule

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ExtModule

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

ExtModule represents an external module.

func New

func New(
	address string,
	isSecure bool,
	router router.Router,
	sonar *sonar.Sonar,
	opts Options,
) *ExtModule

New returns a new initialized ExtModule instance.

func (*ExtModule) AccountFeatures

func (m *ExtModule) AccountFeatures(ctx context.Context) ([]string, error)

AccountFeatures returns module account features.

func (*ExtModule) InterceptStanza added in v0.52.2

func (m *ExtModule) InterceptStanza(ctx context.Context, stanza stravaganza.Stanza, id int) (stravaganza.Stanza, error)

InterceptStanza will be invoked to allow stanza transformation based on a StanzaInterceptor definition.

func (*ExtModule) Interceptors added in v0.52.2

func (m *ExtModule) Interceptors() []module.StanzaInterceptor

Interceptors returns a set of all module interceptors.

func (*ExtModule) MatchesNamespace

func (m *ExtModule) MatchesNamespace(namespace string) bool

MatchesNamespace tells whether namespace matches external iq handler.

func (*ExtModule) Name

func (m *ExtModule) Name() string

Name returns external module name.

func (*ExtModule) ProcessIQ

func (m *ExtModule) ProcessIQ(ctx context.Context, iq *stravaganza.IQ) error

ProcessIQ will be invoked whenever iq stanza should be processed by this external module.

func (*ExtModule) ServerFeatures

func (m *ExtModule) ServerFeatures(ctx context.Context) ([]string, error)

ServerFeatures returns module server features.

func (*ExtModule) Start

func (m *ExtModule) Start(ctx context.Context) error

Start starts external module.

func (*ExtModule) Stop

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

Stop stops external module.

func (*ExtModule) StreamFeature

func (m *ExtModule) StreamFeature(ctx context.Context, domain string) (stravaganza.Element, error)

StreamFeature returns external module stream feature elements.

type Options

type Options struct {
	// RequestTimeout defines external module request timeout.
	RequestTimeout time.Duration

	// Topics defines all topics to which a external module wants to subscribe to.
	Topics []string

	// NamespaceMatcher defines external module namespace matcher.
	NamespaceMatcher stringmatcher.Matcher

	// Interceptors contains external module StanzaInterceptor set.
	Interceptors []module.StanzaInterceptor
}

Options defines external module options set.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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