Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrNotExistingAccount will be returned if destination user does not exist. ErrNotExistingAccount = errors.New("route: account does not exist") // ErrResourceNotFound will be returned if destination resource does not match any of user's available resource. ErrResourceNotFound = errors.New("route: resource not found") // ErrNotAuthenticated will be returned if destination user is not authenticated at this time. ErrNotAuthenticated = errors.New("route: user not authenticated") // ErrBlockedJID will be returned if destination user is not authenticated at this time. ErrBlockedJID = errors.New("route: destination JID is blocked") // ErrFailedRemoteConnect will be returned if it couldn't establish a connection to the remote server. ErrFailedRemoteConnect = errors.New("route: failed remote connection") )
Functions ¶
This section is empty.
Types ¶
type C2SRouter ¶
type C2SRouter interface { // Route routes a stanza applying server rules for handling XML stanzas. // (https://xmpp.org/rfcs/rfc3921.html#rules) Route(ctx context.Context, stanza xmpp.Stanza, validateStanza bool) error // Bind sets a c2s stream as bound. Bind(stm stream.C2S) // Unbind unbinds a previously bound c2s stream. Unbind(username, resource string) // Stream returns the stream associated to a given username and resource. Stream(username, resource string) stream.C2S // Streams returns all steams associated to a given username. Streams(username string) []stream.C2S }
C2SRouter represents a router between client and server.
type Router ¶
type Router interface { // Hosts returns router hosts container. Hosts() *host.Hosts // Route routes a stanza applying server rules for handling XML stanzas. // (https://xmpp.org/rfcs/rfc3921.html#rules) Route(ctx context.Context, stanza xmpp.Stanza) error // MustRoute forces stanza routing by ignoring user's blocking list. MustRoute(ctx context.Context, stanza xmpp.Stanza) error // Bind sets a c2s stream as bound. Bind(ctx context.Context, stm stream.C2S) // Unbind unbinds a previously bound c2s stream. Unbind(ctx context.Context, j *jid.JID) // LocalStream returns the steam associated to a given username and resource. LocalStream(username, resource string) stream.C2S // LocalStreams returns all steams associated to a given username. LocalStreams(username string) []stream.C2S }
Router represents a router between two entities.
Click to show internal directories.
Click to hide internal directories.