module

package
v0.3.5 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2018 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

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 Module

type Module interface {
}

Module represents a generic XMPP module.

type Modules added in v0.3.2

type Modules 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
}

Modules structure keeps reference to a set of preconfigured modules.

func New added in v0.3.4

func New(config *Config, router *router.Router) *Modules

New returns a set of modules derived from a concrete configuration.

func (*Modules) ProcessIQ added in v0.3.4

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

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

func (*Modules) Shutdown added in v0.3.4

func (m *Modules) Shutdown(ctx context.Context) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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