module

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: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Initialize added in v0.3.2

func Initialize(cfg *Config)

Initialize initializes module component.

func ProcessIQ added in v0.3.2

func ProcessIQ(iq *xmpp.IQ, stm stream.C2S)

ProcessIQ process a module IQ returning 'service unavailable' in case it can't be properly handled.

func Shutdown added in v0.3.2

func Shutdown()

Shutdown shuts down module sub system stopping every active module.

Types

type Config added in v0.3.0

type Config struct {
	Enabled      map[string]struct{}
	Roster       roster.Config
	Offline      offline.Config
	Registration xep0077.Config
	Version      xep0092.Config
	Ping         xep0199.Config
}

Config represents C2S modules configuration.

func (*Config) UnmarshalYAML added in v0.3.0

func (cfg *Config) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML satisfies Unmarshaler interface.

type IQHandler

type IQHandler interface {
	Module

	// MatchesIQ returns whether or not an IQ should be
	// processed by the module.
	MatchesIQ(iq *xmpp.IQ) bool

	// ProcessIQ processes a module IQ taking according actions
	// over the associated stream.
	ProcessIQ(iq *xmpp.IQ, stm stream.C2S)
}

IQHandler represents an IQ handler module.

type Mods added in v0.3.2

type Mods struct {
	Roster       *roster.Roster
	Offline      *offline.Offline
	LastActivity *xep0012.LastActivity
	Private      *xep0049.Private
	DiscoInfo    *xep0030.DiscoInfo
	VCard        *xep0054.VCard
	Register     *xep0077.Register
	Version      *xep0092.Version
	BlockingCmd  *xep0191.BlockingCommand
	Ping         *xep0199.Ping
	// contains filtered or unexported fields
}

Mods structure keeps reference to all active modules.

func Modules added in v0.3.2

func Modules() Mods

Modules returns current active modules.

type Module

type Module interface {
}

Module represents a generic XMPP module.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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