xep0030

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2018 License: GPL-3.0 Imports: 5 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(stm stream.C2S) *DiscoInfo

New returns a disco info IQ handler module.

func (*DiscoInfo) Entity

func (di *DiscoInfo) Entity(jid, node string) *Entity

Entity returns a previously registered disco entity.

func (*DiscoInfo) MatchesIQ

func (di *DiscoInfo) MatchesIQ(iq *xml.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 *xml.IQ)

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

func (*DiscoInfo) RegisterDefaultEntities

func (di *DiscoInfo) RegisterDefaultEntities() error

RegisterDefaultEntities register and sets identities for the default domain and account disco entities.

func (*DiscoInfo) RegisterDisco added in v0.3.0

func (di *DiscoInfo) RegisterDisco(discoInfo *DiscoInfo)

RegisterDisco registers disco entity features/items associated to disco info module.

func (*DiscoInfo) RegisterEntity

func (di *DiscoInfo) RegisterEntity(jid, node string) (*Entity, error)

RegisterEntity registers a new disco entity associated to a jid and an optional node.

type Entity

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

Entity represents a disco info item entity.

func (*Entity) AddFeature

func (e *Entity) AddFeature(feature Feature)

AddFeature adds a new disco entity feature.

func (*Entity) AddIdentity

func (e *Entity) AddIdentity(identity Identity)

AddIdentity adds a new disco entity identity.

func (*Entity) AddItem

func (e *Entity) AddItem(item Item)

AddItem adds a new disco entity item.

func (*Entity) Features

func (e *Entity) Features() []Feature

Features returns disco entity features.

func (*Entity) Identities

func (e *Entity) Identities() []Identity

Identities returns disco entity identities.

func (*Entity) Items

func (e *Entity) Items() []Item

Items returns disco entity items.

func (*Entity) RemoveFeature added in v0.3.0

func (e *Entity) RemoveFeature(feature Feature)

RemoveFeature removes a disco feature from entity.

func (*Entity) RemoveIdentity added in v0.3.0

func (e *Entity) RemoveIdentity(identity Identity)

RemoveIdentity removes a disco identity from entity.

func (*Entity) RemoveItem added in v0.3.0

func (e *Entity) RemoveItem(item Item)

RemoveItem removes a disco item from entity.

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.

Jump to

Keyboard shortcuts

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