Documentation ¶
Index ¶
- func NewRouter(outProvider *OutProvider) router.S2SRouter
- type DialbackParams
- type InHub
- type Options
- type OutProvider
- func (p *OutProvider) GetDialback(ctx context.Context, sender, target string, params DialbackParams) (stream.S2SDialback, error)
- func (p *OutProvider) GetOut(ctx context.Context, sender, target string) (stream.S2SOut, error)
- func (p *OutProvider) Start(_ context.Context) error
- func (p *OutProvider) Stop(ctx context.Context) error
- type SocketListener
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewRouter ¶ added in v0.50.0
func NewRouter(outProvider *OutProvider) router.S2SRouter
NewRouter creates and returns an initialized S2S router.
Types ¶
type DialbackParams ¶ added in v0.50.0
type DialbackParams struct { // StreamID represents verification stream identifier. StreamID string // From represents verification sender domain. From string // To represents verification target domain. To string // Key is the dialback generated key. Key string }
DialbackParams contains S2S dialback verification parameters.
type InHub ¶ added in v0.50.0
type InHub struct {
// contains filtered or unexported fields
}
InHub represents an S2S incoming connection hub.
func NewInHub ¶ added in v0.50.0
func NewInHub() *InHub
NewInHub creates and initializes a new InHub instance.
type Options ¶ added in v0.50.0
type Options struct { DialTimeout time.Duration DialbackSecret string // ConnectTimeout defines connection timeout. ConnectTimeout time.Duration // KeepAlive defines stream read timeout. KeepAlive time.Duration // RequestTimeout defines S2S stream request timeout. RequestTimeout time.Duration // MaxStanzaSize is the maximum size a listener incoming stanza may have. MaxStanzaSize int // UseTLS, if true, tls.Listen will be used as network listener. UseTLS bool // TLSConfig contains configuration to be used when TLS listener is enabled. TLSConfig *tls.Config }
Options defines S2S connection options.
type OutProvider ¶ added in v0.10.1
type OutProvider struct {
// contains filtered or unexported fields
}
OutProvider is an outgoing S2S stream provider.
func NewOutProvider ¶ added in v0.10.1
func NewOutProvider( hosts *host.Hosts, kv kv.KV, shapers shaper.Shapers, sn *sonar.Sonar, opts Options, ) *OutProvider
NewOutProvider creates and initializes a new OutProvider instance.
func (*OutProvider) GetDialback ¶ added in v0.50.0
func (p *OutProvider) GetDialback(ctx context.Context, sender, target string, params DialbackParams) (stream.S2SDialback, error)
GetDialback returns associated dialback S2S stream given a sender-target pair domain and a parameters set.
func (*OutProvider) GetOut ¶ added in v0.10.1
GetOut returns associated outgoing S2S stream given a sender-target pair domain.
type SocketListener ¶ added in v0.50.0
type SocketListener struct {
// contains filtered or unexported fields
}
SocketListener represents a S2S socket listener type.
func NewSocketListener ¶ added in v0.50.0
func NewSocketListener( bindAddr string, port int, hosts *host.Hosts, router router.Router, comps *component.Components, mods *module.Modules, outProvider *OutProvider, inHub *InHub, kv kv.KV, shapers shaper.Shapers, sonar *sonar.Sonar, opts Options, ) *SocketListener
NewSocketListener returns a new S2S socket listener.