xep0030

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2018 License: GPL-3.0 Imports: 9 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(shutdownCh <-chan struct{}) *DiscoInfo

New returns a disco info IQ handler module.

func (*DiscoInfo) MatchesIQ

func (di *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 (di *DiscoInfo) ProcessIQ(iq *xmpp.IQ, stm stream.C2S)

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

func (*DiscoInfo) RegisterAccountFeature added in v0.3.2

func (di *DiscoInfo) RegisterAccountFeature(feature string)

RegisterAccountFeature registers a new feature associated to all account domains.

func (*DiscoInfo) RegisterProvider added in v0.3.2

func (di *DiscoInfo) RegisterProvider(domain string, provider Provider)

RegisterProvider registers a new disco info provider given a domain name.

func (*DiscoInfo) RegisterServerFeature added in v0.3.2

func (di *DiscoInfo) RegisterServerFeature(feature string)

RegisterServerFeature registers a new feature associated to server domain.

func (*DiscoInfo) UnregisterAccountFeature added in v0.3.2

func (di *DiscoInfo) UnregisterAccountFeature(feature string)

UnregisterAccountFeature unregisters a previous registered account feature.

func (*DiscoInfo) UnregisterProvider added in v0.3.2

func (di *DiscoInfo) UnregisterProvider(domain string)

UnregisterProvider unregisters a previously registered disco info provider.

func (*DiscoInfo) UnregisterServerFeature added in v0.3.2

func (di *DiscoInfo) UnregisterServerFeature(feature string)

UnregisterServerFeature unregisters a previous registered server feature.

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 Item

type Item struct {
	Jid  string
	Name string
	Node string
}

Item represents a disco info item entity.

type Provider added in v0.3.2

type Provider interface {
	// Identities returns all identities associated to the provider.
	Identities(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(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(toJID, fromJID *jid.JID, node string) ([]Feature, *xmpp.StanzaError)
}

Provider represents a generic disco info domain provider.

Jump to

Keyboard shortcuts

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