Documentation
¶
Index ¶
- Constants
- type AllocateEvent
- type BaseEvent
- type Client
- func (c *Client) OnPublish(_ *centrifuge.Subscription, e centrifuge.PublishEvent)
- func (c *Client) OnSubscribeError(_ *centrifuge.Subscription, _ centrifuge.SubscribeErrorEvent)
- func (c *Client) OnSubscribeSuccess(_ *centrifuge.Subscription, _ centrifuge.SubscribeSuccessEvent)
- func (c *Client) RegisterCallback(ev EventType, cb func(Event))
- func (c *Client) Start() error
- func (c *Client) Stop() error
- type DeallocateEvent
- type Event
- type EventType
Constants ¶
const ( // AllocateEventType represents an event received by the server when it is allocated. AllocateEventType = EventType("AllocateEventType") // DeallocateEventType represents an event received by the server when it is deallocated. DeallocateEventType = EventType("DeallocateEventType") )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AllocateEvent ¶
AllocateEvent represents the data received on an allocation event.
type BaseEvent ¶
type BaseEvent struct { Typ EventType `json:"EventType"` EventID string `json:"EventID"` ServerID int64 `json:"ServerID"` }
BaseEvent represents the base structure of all events received by the subscriber.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client represents a client to the local proxy.
func (*Client) OnPublish ¶
func (c *Client) OnPublish(_ *centrifuge.Subscription, e centrifuge.PublishEvent)
OnPublish implements centrifuge.PublishHandler and is triggered when a message is published to this subscriber.
func (*Client) OnSubscribeError ¶
func (c *Client) OnSubscribeError(_ *centrifuge.Subscription, _ centrifuge.SubscribeErrorEvent)
OnSubscribeError implements centrifuge.SubscribeErrorHandler and is triggered when an error is encountered with this subscriber.
func (*Client) OnSubscribeSuccess ¶
func (c *Client) OnSubscribeSuccess(_ *centrifuge.Subscription, _ centrifuge.SubscribeSuccessEvent)
OnSubscribeSuccess implements centrifuge.SubscribeSuccessHandler and is triggered when the client has successfully subscribed to the broker.
func (*Client) RegisterCallback ¶
RegisterCallback registers a callback function for the specified EventType.
type DeallocateEvent ¶
DeallocateEvent represents the data received on a deallocation event.