realtime

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2019 License: Apache-2.0 Imports: 19 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Module

type Module struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

Module is responsible for managing the realtime module

func Init

func Init(nodeID string, eventing *eventing.Module, auth *auth.Module, crud *crud.Module,
	functions *functions.Module, adminMan *admin.Manager, syncMan *syncman.SyncManager) (*Module, error)

Init creates a new instance of the realtime module

func (*Module) AddLiveQuery

func (m *Module) AddLiveQuery(id, project, dbType, group, clientID string, whereObj map[string]interface{}, sendFeed SendFeed)

AddLiveQuery tracks a client for a live query

func (*Module) RemoveClient

func (m *Module) RemoveClient(clientID string)

RemoveClient removes a client

func (*Module) RemoveLiveQuery

func (m *Module) RemoveLiveQuery(dbType, group, clientID, queryID string)

RemoveLiveQuery removes a particular live query

func (*Module) SetConfig

func (m *Module) SetConfig(project string, crudConfig config.Crud)

SetConfig set the rules and secret key required by the crud block

func (*Module) Subscribe

func (m *Module) Subscribe(ctx context.Context, clientID string, 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.

type SendFeed

type SendFeed func(*model.FeedData)

SendFeed is the function called whenever a data point (feed) is to be sent

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL