Documentation ¶
Index ¶
- func GRPCKeyAuth(key string) grpc.ServerOption
- func RegisterGRPCServerAPI(n *centrifuge.Node, apiExecutor *Executor, server *grpc.Server, ...) error
- type Config
- type Executor
- func (h *Executor) Batch(ctx context.Context, req *BatchRequest) *BatchResponse
- func (h *Executor) Broadcast(_ context.Context, cmd *BroadcastRequest) *BroadcastResponse
- func (h *Executor) Channels(ctx context.Context, cmd *ChannelsRequest) *ChannelsResponse
- func (h *Executor) Disconnect(_ context.Context, cmd *DisconnectRequest) *DisconnectResponse
- func (h *Executor) History(_ context.Context, cmd *HistoryRequest) *HistoryResponse
- func (h *Executor) HistoryRemove(_ context.Context, cmd *HistoryRemoveRequest) *HistoryRemoveResponse
- func (h *Executor) Info(_ context.Context, _ *InfoRequest) *InfoResponse
- func (h *Executor) Presence(_ context.Context, cmd *PresenceRequest) *PresenceResponse
- func (h *Executor) PresenceStats(_ context.Context, cmd *PresenceStatsRequest) *PresenceStatsResponse
- func (h *Executor) Publish(_ context.Context, cmd *PublishRequest) *PublishResponse
- func (h *Executor) RPC(ctx context.Context, cmd *RPCRequest) *RPCResponse
- func (h *Executor) Refresh(_ context.Context, cmd *RefreshRequest) *RefreshResponse
- func (h *Executor) SetRPCExtension(method string, handler RPCHandler)
- func (h *Executor) Subscribe(_ context.Context, cmd *SubscribeRequest) *SubscribeResponse
- func (h *Executor) Unsubscribe(_ context.Context, cmd *UnsubscribeRequest) *UnsubscribeResponse
- type GRPCAPIServiceConfig
- type Handler
- type RPCHandler
- type SurveyCaller
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GRPCKeyAuth ¶
func GRPCKeyAuth(key string) grpc.ServerOption
GRPCKeyAuth allows to set simple authentication based on string key from configuration. Client should provide per RPC credentials: set authorization key to metadata with value `apikey <KEY>`.
func RegisterGRPCServerAPI ¶
func RegisterGRPCServerAPI(n *centrifuge.Node, apiExecutor *Executor, server *grpc.Server, config GRPCAPIServiceConfig) error
RegisterGRPCServerAPI registers GRPC API service in provided GRPC server.
Types ¶
type Executor ¶
type Executor struct {
// contains filtered or unexported fields
}
Executor can run API methods.
func NewExecutor ¶
func NewExecutor(n *centrifuge.Node, ruleContainer *rule.Container, surveyCaller SurveyCaller, protocol string) *Executor
NewExecutor ...
func (*Executor) Disconnect ¶
Disconnect disconnects user by its ID and sends disconnect control message to other nodes, so they could also disconnect user.
func (*Executor) HistoryRemove ¶
func (h *Executor) HistoryRemove(_ context.Context, cmd *HistoryRemoveRequest) *HistoryRemoveResponse
HistoryRemove removes all history information for channel.
func (*Executor) PresenceStats ¶
func (h *Executor) PresenceStats(_ context.Context, cmd *PresenceStatsRequest) *PresenceStatsResponse
PresenceStats returns response with presence stats information for channel.
func (*Executor) SetRPCExtension ¶
func (h *Executor) SetRPCExtension(method string, handler RPCHandler)
SetRPCExtension ...
func (*Executor) Subscribe ¶
Subscribe subscribes user to a channel and sends subscribe control message to other nodes, so they could also subscribe user.
func (*Executor) Unsubscribe ¶
Unsubscribe unsubscribes user from channel and sends unsubscribe control message to other nodes, so they could also unsubscribe user.
type GRPCAPIServiceConfig ¶
type GRPCAPIServiceConfig struct{}
GRPCAPIServiceConfig for GRPC API Service.
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler is responsible for processing API commands over HTTP.
func NewHandler ¶
func NewHandler(n *centrifuge.Node, apiExecutor *Executor, c Config) *Handler
NewHandler creates new APIHandler.
func (*Handler) OldRoute ¶ added in v4.1.3
func (s *Handler) OldRoute() http.HandlerFunc
OldRoute handles all methods inside one /api handler. The plan is to remove it in Centrifugo v6.
type RPCHandler ¶
RPCHandler allows to handle custom RPC.