server

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: May 20, 2018 License: MPL-2.0 Imports: 43 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Initialize

func Initialize(srvConfigurations []Config, debugPort int)

Initialize spawns a connection listener for every server configuration.

func Shutdown

func Shutdown()

Shutdown closes every server listener. This method should be used only for testing purposes.

Types

type CompressConfig added in v0.2.0

type CompressConfig struct {
	Level compress.Level
}

CompressConfig represents a server stream compression configuration.

func (*CompressConfig) UnmarshalYAML added in v0.2.0

func (c *CompressConfig) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML satisfies Unmarshaler interface.

type Config added in v0.2.0

type Config struct {
	ID               string
	Type             ServerType
	ResourceConflict ResourceConflictPolicy
	Transport        TransportConfig
	SASL             []string
	TLS              TLSConfig
	Modules          map[string]struct{}
	Compression      CompressConfig
	ModRoster        roster.Config
	ModOffline       offline.Config
	ModRegistration  xep0077.Config
	ModVersion       xep0092.Config
	ModPing          xep0199.Config
}

Config represents an XMPP server configuration.

func (*Config) UnmarshalYAML added in v0.2.0

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

UnmarshalYAML satisfies Unmarshaler interface.

type ResourceConflictPolicy added in v0.2.0

type ResourceConflictPolicy int

ResourceConflictPolicy represents a resource conflict policy.

const (
	// Override represents 'override' resource conflict policy.
	Override ResourceConflictPolicy = iota

	// Reject represents 'reject' resource conflict policy.
	Reject

	// Replace represents 'replace' resource conflict policy.
	Replace
)

type ServerType added in v0.2.0

type ServerType int

ServerType represents a server type (c2s, s2s).

const (
	// C2SServerType represents a client to client server type.
	C2SServerType ServerType = iota
	// S2SServerType represents a server-to-client server type.
	S2SServerType
)

func (ServerType) String added in v0.2.0

func (st ServerType) String() string

String returns ServerType string representation.

type TLSConfig added in v0.2.0

type TLSConfig struct {
	CertFile    string `yaml:"cert_path"`
	PrivKeyFile string `yaml:"privkey_path"`
}

TLSConfig represents a server TLS configuration.

type TransportConfig added in v0.2.0

type TransportConfig struct {
	Type           transport.TransportType
	BindAddress    string
	Port           int
	ConnectTimeout int
	KeepAlive      int
	MaxStanzaSize  int
}

TransportConfig represents an XMPP stream transport configuration.

func (*TransportConfig) UnmarshalYAML added in v0.2.0

func (t *TransportConfig) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML satisfies Unmarshaler interface.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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