Documentation
¶
Index ¶
- Variables
- type Config
- type HostConfig
- type Router
- func (r *Router) Bind(stm stream.C2S)
- func (r *Router) Certificates() []tls.Certificate
- func (r *Router) HostNames() []string
- func (r *Router) IsBlockedJID(jid *jid.JID, username string) bool
- func (r *Router) IsLocalHost(domain string) bool
- func (r *Router) MustRoute(stanza xmpp.Stanza) error
- func (r *Router) ReloadBlockList(username string)
- func (r *Router) Route(stanza xmpp.Stanza) error
- func (r *Router) SetS2SOutProvider(s2sOutProvider S2SOutProvider)
- func (r *Router) Unbind(stm stream.C2S)
- func (r *Router) UserStreams(username string) []stream.C2S
- type S2SOutProvider
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrNotExistingAccount will be returned by Route method // if destination user does not exist. ErrNotExistingAccount = errors.New("router: account does not exist") // ErrResourceNotFound will be returned by Route method // if destination resource does not match any of user's available resources. ErrResourceNotFound = errors.New("router: resource not found") // ErrNotAuthenticated will be returned by Route method if // destination user is not available at this moment. ErrNotAuthenticated = errors.New("router: user not authenticated") // ErrBlockedJID will be returned by Route method if // destination JID matches any of the user's blocked JID. ErrBlockedJID = errors.New("router: destination jid is blocked") // ErrFailedRemoteConnect will be returned by Route method if // couldn't establish a connection to the remote server. ErrFailedRemoteConnect = errors.New("router: failed remote connection") )
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Hosts []HostConfig `yaml:"hosts"`
}
type HostConfig ¶ added in v0.3.4
type HostConfig struct { Name string Certificate tls.Certificate }
func (*HostConfig) UnmarshalYAML ¶ added in v0.3.4
func (c *HostConfig) UnmarshalYAML(unmarshal func(interface{}) error) error
UnmarshalYAML satisfies Unmarshaler interface.
type Router ¶ added in v0.3.4
type Router struct {
// contains filtered or unexported fields
}
func (*Router) Bind ¶ added in v0.3.4
Bind marks a c2s stream as binded. An error will be returned in case no assigned resource is found.
func (*Router) Certificates ¶ added in v0.3.4
func (r *Router) Certificates() []tls.Certificate
func (*Router) IsBlockedJID ¶ added in v0.3.4
IsBlockedJID returns whether or not the passed jid matches any of a user's blocking list JID.
func (*Router) IsLocalHost ¶ added in v0.3.4
func (*Router) MustRoute ¶ added in v0.3.4
MustRoute routes a stanza applying server rules for handling XML stanzas ignoring blocking lists.
func (*Router) ReloadBlockList ¶ added in v0.3.4
ReloadBlockList reloads in memory block list for a given user and starts applying it for future stanza routing.
func (*Router) Route ¶ added in v0.3.4
Route routes a stanza applying server rules for handling XML stanzas. (https://xmpp.org/rfcs/rfc3921.html#rules)
func (*Router) SetS2SOutProvider ¶ added in v0.3.4
func (r *Router) SetS2SOutProvider(s2sOutProvider S2SOutProvider)
Click to show internal directories.
Click to hide internal directories.