s2s

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 Config

type Config struct {
	ID             string
	DialTimeout    time.Duration
	ConnectTimeout time.Duration
	KeepAlive      time.Duration
	Timeout        time.Duration
	DialbackSecret string
	MaxStanzaSize  int
	Transport      TransportConfig
}

Config represents an s2s configuration.

func (*Config) UnmarshalYAML

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

UnmarshalYAML satisfies Unmarshaler interface.

type Dialer

type Dialer interface {
	Dial(ctx context.Context, remoteDomain string) (net.Conn, error)
}

Dialer represents a dialer interface.

type OutProvider

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

OutProvider represents out stream provider.

func NewOutProvider

func NewOutProvider(config *Config, hosts *host.Hosts) *OutProvider

NewOutProvider returns a new OutProvider.

func (*OutProvider) GetOut

func (p *OutProvider) GetOut(localDomain, remoteDomain string) stream.S2SOut

GetOut returns an out stream.

func (*OutProvider) Shutdown

func (p *OutProvider) Shutdown(ctx context.Context) error

Shutdown close server out stream.

type S2S

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

S2S represents a server-to-server connection manager.

func New

func New(config *Config, mods *module.Modules, outProvider *OutProvider, router router.Router) *S2S

New returns a new instance of an s2s connection manager.

func (*S2S) Shutdown

func (s *S2S) Shutdown(ctx context.Context)

Shutdown gracefully shuts down s2s manager.

func (*S2S) Start

func (s *S2S) Start()

Start initializes s2s manager.

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 {
	BindAddress string
	Port        int
}

TransportConfig represents s2s transport configuration.

func (*TransportConfig) UnmarshalYAML

func (c *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