c2s

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type C2S added in v0.3.4

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

C2S represents a client-to-server connection manager.

func New added in v0.3.4

func New(configs []Config, mods *module.Modules, comps *component.Components, router *router.Router) (*C2S, error)

New returns a new instance of a c2s connection manager.

func (*C2S) Shutdown added in v0.3.4

func (c *C2S) Shutdown(ctx context.Context)

Shutdown gracefully shuts down c2s manager.

func (*C2S) Start added in v0.3.4

func (c *C2S) Start()

Start initializes c2s manager spawning every single server.

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