xep0030

package
v0.0.0-...-aeec266 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2021 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Index

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

func (x *DiscoInfo) MatchesIQ(iq *xmpp.IQ) bool

MatchesIQ returns whether or not an IQ should be processed by the disco info module.

func (*DiscoInfo) ProcessIQ

func (x *DiscoInfo) ProcessIQ(ctx context.Context, iq *xmpp.IQ)

ProcessIQ processes a disco info IQ taking according actions over the associated stream.

func (*DiscoInfo) RegisterAccountFeature

func (x *DiscoInfo) RegisterAccountFeature(feature string)

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

func (x *DiscoInfo) RegisterServerFeature(feature string)

RegisterServerFeature registers a new feature associated to server domain.

func (*DiscoInfo) RegisterServerItem

func (x *DiscoInfo) RegisterServerItem(item Item)

RegisterServerItem registers a new item associated to server domain.

func (*DiscoInfo) Shutdown

func (x *DiscoInfo) Shutdown() error

Shutdown shuts down disco info module.

func (*DiscoInfo) UnregisterAccountFeature

func (x *DiscoInfo) UnregisterAccountFeature(feature string)

UnregisterAccountFeature unregisters a previously registered account feature.

func (*DiscoInfo) UnregisterProvider

func (x *DiscoInfo) UnregisterProvider(domain string)

UnregisterProvider unregisters a previously registered disco info provider.

func (*DiscoInfo) UnregisterServerFeature

func (x *DiscoInfo) UnregisterServerFeature(feature string)

UnregisterServerFeature unregisters a previously registered server feature.

func (*DiscoInfo) UnregisterServerItem

func (x *DiscoInfo) UnregisterServerItem(item Item)

UnregisterServerItem unregisters a previously registered server item.

type Feature

type Feature = string

Feature represents a disco info feature entity.

type Identity

type Identity struct {
	Category string
	Type     string
	Name     string
}

Identity represents a disco info identity entity.

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.

type Item

type Item struct {
	Jid  string
	Name string
	Node string
}

Item represents a disco info item entity.

Jump to

Keyboard shortcuts

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