Documentation ¶
Index ¶
- type DiscoInfo
- func (x *DiscoInfo) MatchesIQ(iq *xmpp.IQ) bool
- func (x *DiscoInfo) ProcessIQ(ctx context.Context, iq *xmpp.IQ)
- func (x *DiscoInfo) RegisterAccountFeature(feature string)
- func (x *DiscoInfo) RegisterProvider(domain string, provider InfoProvider)
- func (x *DiscoInfo) RegisterServerFeature(feature string)
- func (x *DiscoInfo) RegisterServerItem(item Item)
- func (x *DiscoInfo) Shutdown() error
- func (x *DiscoInfo) UnregisterAccountFeature(feature string)
- func (x *DiscoInfo) UnregisterProvider(domain string)
- func (x *DiscoInfo) UnregisterServerFeature(feature string)
- func (x *DiscoInfo) UnregisterServerItem(item Item)
- type Feature
- type Identity
- type InfoProvider
- type Item
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DiscoInfo ¶
type DiscoInfo struct {
// contains filtered or unexported fields
}
DiscoInfo represents a disco info server stream module.
func New ¶
func New(router router.Router, rosterRep repository.Roster) *DiscoInfo
New returns a disco info IQ handler module.
func (*DiscoInfo) MatchesIQ ¶
MatchesIQ returns whether or not an IQ should be processed by the disco info module.
func (*DiscoInfo) ProcessIQ ¶
ProcessIQ processes a disco info IQ taking according actions over the associated stream.
func (*DiscoInfo) RegisterAccountFeature ¶
RegisterAccountFeature registers a new feature associated to all account domains.
func (*DiscoInfo) RegisterProvider ¶
func (x *DiscoInfo) RegisterProvider(domain string, provider InfoProvider)
RegisterProvider registers a new disco info provider associated to a domain.
func (*DiscoInfo) RegisterServerFeature ¶
RegisterServerFeature registers a new feature associated to server domain.
func (*DiscoInfo) RegisterServerItem ¶
RegisterServerItem registers a new item associated to server domain.
func (*DiscoInfo) UnregisterAccountFeature ¶
UnregisterAccountFeature unregisters a previously registered account feature.
func (*DiscoInfo) UnregisterProvider ¶
UnregisterProvider unregisters a previously registered disco info provider.
func (*DiscoInfo) UnregisterServerFeature ¶
UnregisterServerFeature unregisters a previously registered server feature.
func (*DiscoInfo) UnregisterServerItem ¶
UnregisterServerItem unregisters a previously registered server item.
type InfoProvider ¶
type InfoProvider interface { // Identities returns all identities associated to the provider. Identities(ctx context.Context, toJID, fromJID *jid.JID, node string) []Identity // Items returns all items associated to the provider. // A proper stanza error should be returned in case an error occurs. Items(ctx context.Context, toJID, fromJID *jid.JID, node string) ([]Item, *xmpp.StanzaError) // Features returns all features associated to the provider. // A proper stanza error should be returned in case an error occurs. Features(ctx context.Context, toJID, fromJID *jid.JID, node string) ([]Feature, *xmpp.StanzaError) // ResultForm returns the data form associated to the provider. // A proper stanza error should be returned in case an error occurs. Form(ctx context.Context, toJID, fromJID *jid.JID, node string) (*xep0004.DataForm, *xmpp.StanzaError) }
InfoProvider represents a generic disco info domain provider.