c2s

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Initialize

func Initialize(srvConfigurations []Config)

Initialize initializes c2s sub system spawning 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

type CompressConfig struct {
	Level compress.Level
}

CompressConfig represents a server Stream compression configuration.

func (*CompressConfig) UnmarshalYAML

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

UnmarshalYAML satisfies Unmarshaler interface.

type Config

type Config struct {
	ID               string
	ConnectTimeout   time.Duration
	MaxStanzaSize    int
	ResourceConflict ResourceConflictPolicy
	Transport        TransportConfig
	SASL             []string
	Compression      CompressConfig
}

Config represents C2S server configuration.

func (*Config) UnmarshalYAML

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

UnmarshalYAML satisfies Unmarshaler interface.

type ResourceConflictPolicy

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 TLSConfig

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

TLSConfig represents a server TLS configuration.

type TransportConfig

type TransportConfig struct {
	Type        transport.TransportType
	BindAddress string
	Port        int
	KeepAlive   time.Duration
	URLPath     string
}

TransportConfig represents an XMPP stream transport configuration.

func (*TransportConfig) UnmarshalYAML

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

UnmarshalYAML satisfies Unmarshaler interface.

Jump to

Keyboard shortcuts

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