Documentation ¶
Index ¶
- type Client
- type Handler
- func (h *Handler) OnClientConnecting(ctx context.Context, e centrifuge.ConnectEvent, ...) (centrifuge.ConnectReply, error)
- func (h *Handler) OnHistory(c Client, e centrifuge.HistoryEvent) (centrifuge.HistoryReply, error)
- func (h *Handler) OnPresence(c Client, e centrifuge.PresenceEvent) (centrifuge.PresenceReply, error)
- func (h *Handler) OnPresenceStats(c Client, e centrifuge.PresenceStatsEvent) (centrifuge.PresenceStatsReply, error)
- func (h *Handler) OnPublish(c Client, e centrifuge.PublishEvent, ...) (centrifuge.PublishReply, error)
- func (h *Handler) OnRPC(c Client, e centrifuge.RPCEvent, rpcProxyHandler proxy.RPCHandlerFunc) (centrifuge.RPCReply, error)
- func (h *Handler) OnRefresh(c Client, e centrifuge.RefreshEvent, ...) (centrifuge.RefreshReply, RefreshExtra, error)
- func (h *Handler) OnSubRefresh(c Client, subRefreshProxyHandler proxy.SubRefreshHandlerFunc, ...) (centrifuge.SubRefreshReply, SubRefreshExtra, error)
- func (h *Handler) OnSubscribe(c Client, e centrifuge.SubscribeEvent, ...) (centrifuge.SubscribeReply, SubscribeExtra, error)
- func (h *Handler) SetRPCExtension(method string, handler RPCExtensionFunc)
- func (h *Handler) Setup() error
- type ProxyMap
- type RPCExtensionFunc
- type RefreshExtra
- type SubRefreshExtra
- type SubscribeExtra
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface { ID() string UserID() string IsSubscribed(string) bool Context() context.Context Transport() centrifuge.TransportInfo AcquireStorage() (map[string]any, func(map[string]any)) Unsubscribe(ch string, unsubscribe ...centrifuge.Unsubscribe) WritePublication(channel string, publication *centrifuge.Publication, sp centrifuge.StreamPosition) error }
Client represents client connection.
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler ...
func NewHandler ¶
func NewHandler( node *centrifuge.Node, ruleContainer *rule.Container, tokenVerifier *jwtverify.VerifierJWT, subTokenVerifier *jwtverify.VerifierJWT, proxyMap *ProxyMap, granularProxyMode bool, ) *Handler
NewHandler ...
func (*Handler) OnClientConnecting ¶
func (h *Handler) OnClientConnecting( ctx context.Context, e centrifuge.ConnectEvent, connectProxyHandler proxy.ConnectingHandlerFunc, refreshProxyEnabled bool, ) (centrifuge.ConnectReply, error)
OnClientConnecting ...
func (*Handler) OnHistory ¶
func (h *Handler) OnHistory(c Client, e centrifuge.HistoryEvent) (centrifuge.HistoryReply, error)
OnHistory ...
func (*Handler) OnPresence ¶
func (h *Handler) OnPresence(c Client, e centrifuge.PresenceEvent) (centrifuge.PresenceReply, error)
OnPresence ...
func (*Handler) OnPresenceStats ¶
func (h *Handler) OnPresenceStats(c Client, e centrifuge.PresenceStatsEvent) (centrifuge.PresenceStatsReply, error)
OnPresenceStats ...
func (*Handler) OnPublish ¶
func (h *Handler) OnPublish(c Client, e centrifuge.PublishEvent, publishProxyHandler proxy.PublishHandlerFunc) (centrifuge.PublishReply, error)
OnPublish ...
func (*Handler) OnRPC ¶
func (h *Handler) OnRPC(c Client, e centrifuge.RPCEvent, rpcProxyHandler proxy.RPCHandlerFunc) (centrifuge.RPCReply, error)
OnRPC ...
func (*Handler) OnRefresh ¶
func (h *Handler) OnRefresh(c Client, e centrifuge.RefreshEvent, refreshProxyHandler proxy.RefreshHandlerFunc) (centrifuge.RefreshReply, RefreshExtra, error)
OnRefresh ...
func (*Handler) OnSubRefresh ¶
func (h *Handler) OnSubRefresh(c Client, subRefreshProxyHandler proxy.SubRefreshHandlerFunc, e centrifuge.SubRefreshEvent) (centrifuge.SubRefreshReply, SubRefreshExtra, error)
OnSubRefresh ...
func (*Handler) OnSubscribe ¶
func (h *Handler) OnSubscribe(c Client, e centrifuge.SubscribeEvent, subscribeProxyHandler proxy.SubscribeHandlerFunc, subscribeStreamHandlerFunc proxy.SubscribeStreamHandlerFunc) (centrifuge.SubscribeReply, SubscribeExtra, error)
OnSubscribe ...
func (*Handler) SetRPCExtension ¶
func (h *Handler) SetRPCExtension(method string, handler RPCExtensionFunc)
SetRPCExtension ...
type ProxyMap ¶
type ProxyMap struct { ConnectProxy proxy.ConnectProxy RefreshProxy proxy.RefreshProxy RpcProxies map[string]proxy.RPCProxy PublishProxies map[string]proxy.PublishProxy SubscribeProxies map[string]proxy.SubscribeProxy SubRefreshProxies map[string]proxy.SubRefreshProxy SubscribeStreamProxies map[string]*proxy.SubscribeStreamProxy }
ProxyMap is a structure which contains all configured and already initialized proxies which can be used from inside client event handlers.
type RPCExtensionFunc ¶
type RPCExtensionFunc func(c Client, e centrifuge.RPCEvent) (centrifuge.RPCReply, error)
RPCExtensionFunc ...
type RefreshExtra ¶
type RefreshExtra struct { Subs map[string]centrifuge.SubscribeOptions CheckSubs bool }
type SubRefreshExtra ¶
type SubRefreshExtra struct { }
type SubscribeExtra ¶
type SubscribeExtra struct { }
Click to show internal directories.
Click to hide internal directories.