client

package
v5.0.3 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

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))
}

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

OnHistory ...

func (*Handler) OnPresence

OnPresence ...

func (*Handler) OnPresenceStats

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

OnRefresh ...

func (*Handler) OnSubRefresh

OnSubRefresh ...

func (*Handler) OnSubscribe

OnSubscribe ...

func (*Handler) SetRPCExtension

func (h *Handler) SetRPCExtension(method string, handler RPCExtensionFunc)

SetRPCExtension ...

func (*Handler) Setup

func (h *Handler) Setup() error

Setup event handlers.

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
}

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 {
}

Jump to

Keyboard shortcuts

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