Documentation
¶
Index ¶
- type ExtModule
- func (m *ExtModule) AccountFeatures(ctx context.Context) ([]string, error)
- func (m *ExtModule) MatchesNamespace(namespace string) bool
- func (m *ExtModule) Name() string
- func (m *ExtModule) PreProcessMessage(ctx context.Context, msg *stravaganza.Message) (*stravaganza.Message, error)
- func (m *ExtModule) PreRouteMessage(ctx context.Context, msg *stravaganza.Message) (*stravaganza.Message, error)
- func (m *ExtModule) ProcessIQ(ctx context.Context, iq *stravaganza.IQ) error
- func (m *ExtModule) ServerFeatures(ctx context.Context) ([]string, error)
- func (m *ExtModule) Start(ctx context.Context) error
- func (m *ExtModule) Stop(_ context.Context) error
- func (m *ExtModule) StreamFeature(ctx context.Context, domain string) (stravaganza.Element, error)
- type Options
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 ¶
AccountFeatures returns module account features.
func (*ExtModule) MatchesNamespace ¶
MatchesNamespace tells whether namespace matches external iq handler.
func (*ExtModule) PreProcessMessage ¶
func (m *ExtModule) PreProcessMessage(ctx context.Context, msg *stravaganza.Message) (*stravaganza.Message, error)
PreProcessMessage will be invoked as soon as a message stanza is received a over a C2S stream.
func (*ExtModule) PreRouteMessage ¶
func (m *ExtModule) PreRouteMessage(ctx context.Context, msg *stravaganza.Message) (*stravaganza.Message, error)
PreRouteMessage will be invoked before a message stanza is routed a over a C2S stream.
func (*ExtModule) ProcessIQ ¶
ProcessIQ will be invoked whenever iq stanza should be processed by this external module.
func (*ExtModule) ServerFeatures ¶
ServerFeatures returns module server features.
func (*ExtModule) StreamFeature ¶
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 is define external module namespace string matcher. NamespaceMatcher stringmatcher.Matcher // IsIQHandler marks external module to behave as an iq handler. IsIQHandler bool // IsMessagePreProcessor marks external module to behave as a message preprocessor. IsMessagePreProcessor bool // IsMessagePreRouter marks external module to behave as a message preprocessor. IsMessagePreRouter bool }
Options defines external module options set.