Documentation
¶
Index ¶
Constants ¶
View Source
const ( SSERouteBroadcast = "eventv2.broadcast" SSEventsExchange = "ror.eventsv2" SSEventsQueueNamePrefix = "sse-events-v2" )
Variables ¶
This section is empty.
Functions ¶
func HandleSSEEvent ¶ added in v1.0.50
func StartEventServer ¶
func StartEventServer()
func StartListeningRabbitMQ ¶ added in v1.0.50
func StartListeningRabbitMQ()
Types ¶
type EventClient ¶
type EventClient struct {
Id EventClientId
Connection EventClientChan
Identity identitymodels.Identity
Subscriptions []Subscription
}
func (*EventClient) Subscribe ¶ added in v1.1.0
func (e *EventClient) Subscribe(topic Subscription)
func (*EventClient) Unsubscribe ¶ added in v1.1.0
func (e *EventClient) Unsubscribe(topic Subscription)
type EventClientChan ¶
type EventClientChan chan SseEvent
type EventClientId ¶
type EventClientId string
func NewEventClientId ¶
func NewEventClientId() EventClientId
type EventClients ¶
type EventClients struct {
// contains filtered or unexported fields
}
func NewEventClients ¶
func NewEventClients() EventClients
func (*EventClients) Add ¶
func (e *EventClients) Add(client *EventClient)
func (*EventClients) Get ¶
func (e *EventClients) Get(id EventClientId) *EventClient
func (*EventClients) GetBroadcast ¶
func (e *EventClients) GetBroadcast() []EventClientId
func (*EventClients) Len ¶
func (e *EventClients) Len() int
func (*EventClients) Remove ¶
func (e *EventClients) Remove(id EventClientId)
type EventMessage ¶
type EventMessage struct {
Clients []EventClientId
SseEvent
}
type EventServer ¶
type EventServer struct {
// Events are pushed to this channel by the main events-gathering routine
Message chan EventMessage
// New client connections
NewClients chan *EventClient
// Closed client connections
ClosedClients chan EventClientId
// Total client connections
Clients EventClients
}
var Server *EventServer
type SSESubscribe ¶ added in v1.1.0
type SSESubscribe struct {
ClientId EventClientId `json:"clientId" validate:"required"`
Topic Subscription `json:"topic" validate:"required"`
}
type Subscription ¶ added in v1.1.0
type Subscription string
Click to show internal directories.
Click to hide internal directories.