client

package
v4.1.5 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SkipUserCheckInSubscriptionToken bool

SkipUserCheckInSubscriptionToken enables mode when user id check is skipped while validating Subscription tokens. This flag exists for those who use Centrifugo v3 and want to migrate on Centrifugo v4. Eventually this flag should be removed – all tokens must be issued for users who initiate connection.

Functions

This section is empty.

Types

type Client added in v4.0.1

type Client interface {
	ID() string
	UserID() string
	IsSubscribed(string) bool
	Context() context.Context
	Transport() centrifuge.TransportInfo
}

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.Verifier,
	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

OnPublish ...

func (*Handler) OnRPC

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 {
	Meta      json.RawMessage
	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