stream

package
v0.61.0 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2022 License: Apache-2.0 Imports: 6 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 interface {
	// ID returns C2S stream identifier.
	ID() C2SID

	// SetInfoValue sets a C2S stream info value.
	SetInfoValue(ctx context.Context, k string, val interface{}) error

	// Info returns C2S stream context.
	Info() c2smodel.Info

	// JID returns stream associated jid or nil if none is set.
	JID() *jid.JID

	// Username returns stream associated username.
	Username() string

	// Domain returns stream associated domain.
	Domain() string

	// Resource returns stream associated resource.
	Resource() string

	// IsSecured returns whether or not the XMPP stream has been secured using SSL/TLS.
	IsSecured() bool

	// IsAuthenticated returns whether or not the XMPP stream has successfully authenticated.
	IsAuthenticated() bool

	// IsBinded returns whether or not the XMPP stream has completed resource binding.
	IsBinded() bool

	// Presence returns stream associated presence stanza or nil if none is set.
	Presence() *stravaganza.Presence

	// SendElement writes element string representation to the underlying stream transport.
	SendElement(elem stravaganza.Element) <-chan error

	// Disconnect performs disconnection over the stream.
	Disconnect(streamErr *streamerror.Error) <-chan error

	// Resume resumes a previously initiated c2s session.
	Resume(ctx context.Context, jd *jid.JID, pr *stravaganza.Presence, inf c2smodel.Info) error

	// Done returns a channel that's closed when stream transport and all associated resources have been released.
	Done() <-chan struct{}
}

C2S represents a client-to-server XMPP stream.

type C2SID

type C2SID uint64

C2SID type represents a C2S stream unique identifier string.

func (C2SID) String

func (i C2SID) String() string

String returns C2S identifier string representation.

type DialbackResult

type DialbackResult struct {
	// Valid tells whether dialback validation was successfully completed.
	Valid bool

	// Error contains dialback resulting error element.
	// See https://xmpp.org/extensions/xep-0220.html#errors for more details.
	Error stravaganza.Element
}

DialbackResult represents S2S dialback result.

type S2SDialback

type S2SDialback interface {
	// ID returns S2S outgoing stream identifier.
	ID() S2SOutID

	// Disconnect performs disconnection over the stream.
	Disconnect(streamErr *streamerror.Error) <-chan error

	// DialbackResult returns a channel that's signaled when S2S dialback result.
	DialbackResult() <-chan DialbackResult
}

S2SDialback represents a server-to-server dialback XMPP stream.

type S2SIn

type S2SIn interface {
	// ID returns S2S incoming stream identifier.
	ID() S2SInID

	// Disconnect performs disconnection over the stream.
	Disconnect(streamErr *streamerror.Error) <-chan error

	// Done returns a channel that's closed when stream transport and all associated resources have been released.
	Done() <-chan struct{}
}

S2SIn represents an incoming server-to-server XMPP stream.

type S2SInID

type S2SInID uint64

S2SInID type represents an S2S stream unique identifier string.

func (S2SInID) String

func (i S2SInID) String() string

String returns S2SInID identifier string representation.

type S2SOut

type S2SOut interface {
	// ID returns S2S outgoing stream identifier.
	ID() S2SOutID

	// SendElement writes element string representation to the underlying stream transport.
	SendElement(elem stravaganza.Element) <-chan error

	// Disconnect performs disconnection over the stream.
	Disconnect(streamErr *streamerror.Error) <-chan error
}

S2SOut represents an outgoing server-to-server XMPP stream.

type S2SOutID

type S2SOutID struct {
	Sender string
	Target string
}

S2SOutID type represents an S2S outgoing stream unique identifier string.

func (S2SOutID) String

func (i S2SOutID) String() string

String returns S2SOutID identifier string representation.

Jump to

Keyboard shortcuts

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