Documentation ¶
Index ¶
- type Message
- type Module
- func (m *Module) AddLiveQuery(id, project, group, clientID string, whereObj map[string]interface{}, ...)
- func (m *Module) RemoveClient(clientID string)
- func (m *Module) RemoveLiveQuery(group, clientID, queryID string)
- func (m *Module) SendAck(msgID, project, col string, ack bool)
- func (m *Module) SendCreateIntent(project, dbType, col string, req *model.CreateRequest) string
- func (m *Module) SendDeleteIntent(project, dbType, col string, req *model.DeleteRequest) string
- func (m *Module) SendUpdateIntent(project, dbType, col string, req *model.UpdateRequest) string
- func (m *Module) SetConfig(project string, conf *config.Realtime) error
- func (m *Module) Subscribe(ctx context.Context, clientID string, auth *auth.Module, crud *crud.Module, ...) ([]*model.FeedData, error)
- func (m *Module) Unsubscribe(clientID string, data *model.RealtimeRequest)
- type SendFeed
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Message ¶
type Message struct { ID string `json:"id"` Type string `json:"type"` Ack bool `json:"ack"` Data *model.FeedData `json:"feed"` }
Message is the message sent over nats
type Module ¶
Module is responsible for managing the realtime module
func (*Module) AddLiveQuery ¶
func (m *Module) AddLiveQuery(id, project, group, clientID string, whereObj map[string]interface{}, sendFeed SendFeed)
AddLiveQuery tracks a client for a live query
func (*Module) RemoveClient ¶
RemoveClient removes a client
func (*Module) RemoveLiveQuery ¶
RemoveLiveQuery removes a particular live query
func (*Module) SendCreateIntent ¶
func (m *Module) SendCreateIntent(project, dbType, col string, req *model.CreateRequest) string
SendCreateIntent broadcasts a realtime create datapoint to the concerned clients
func (*Module) SendDeleteIntent ¶
func (m *Module) SendDeleteIntent(project, dbType, col string, req *model.DeleteRequest) string
SendDeleteIntent broadcasts a realtime delete datapoint to the concerned clients
func (*Module) SendUpdateIntent ¶
func (m *Module) SendUpdateIntent(project, dbType, col string, req *model.UpdateRequest) string
SendUpdateIntent broadcasts a realtime update datapoint to the concerned clients
func (*Module) Subscribe ¶
func (m *Module) Subscribe(ctx context.Context, clientID string, auth *auth.Module, crud *crud.Module, data *model.RealtimeRequest, sendFeed SendFeed) ([]*model.FeedData, error)
Subscribe performs the realtime subscribe operation.
func (*Module) Unsubscribe ¶
func (m *Module) Unsubscribe(clientID string, data *model.RealtimeRequest)
Unsubscribe performs the realtime unsubscribe operation.
Click to show internal directories.
Click to hide internal directories.