c2s

package
Version: v0.0.0-...-aeec266 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2021 License: BSD-3-Clause Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type C2S

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

C2S represents a client-to-server connection manager.

func New

func New(configs []Config, mods *module.Modules, router router.Router, userRep repository.User, blockListRep repository.BlockList) (*C2S, error)

New returns a new instance of a c2s connection manager.

func (*C2S) Shutdown

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

Shutdown gracefully shuts down c2s manager.

func (*C2S) Start

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
	Timeout          time.Duration
	KeepAlive        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' resouce conflict policy.
	Override ResourceConflictPolicy = iota

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

	// Replace represents 'reject' resouce 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.Type
	BindAddress string
	Port        int
	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.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL