livequery

package
v0.0.0-...-f093712 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2022 License: MIT Imports: 9 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(args map[string]string)

Run 初始化 server ,启动 WebSocket args 支持的参数包括: pattern WebSocket 运行路径,例如: /livequery addr WebSocket 监听地址,例如: 127.0.0.1:8089 logLevel 日志级别,包含: VERBOSE DEBUG INFO ERROR NONE ,默认为 NONE keyPairs 用于校验客户端权限的键值对,JSON格式字符串 例如: {"clientKey":"test"} serverURL talisman 地址 appId talisman 对应的 appId clientKey talisman 对应的 clientKey masterKey talisman 对应的 masterKey subType 订阅服务类型,支持 EventEmitter Redis subURL 订阅服务地址,如果是 EventEmitter 可不填写

Types

type LiveQuery

type LiveQuery struct {
	// contains filtered or unexported fields
}

LiveQuery 接收指定类的对象保存与对象删除的通知,发送对象数据到发布者,由发布者通知订阅者,订阅者实时接收数据

var TLiveQuery *LiveQuery

TLiveQuery ...

func NewLiveQuery

func NewLiveQuery(classNames []string, pubType, pubURL, pubConfig string) *LiveQuery

NewLiveQuery 初始化 LiveQuery classNames 支持的类列表 pubType 发布者类型 pubURL 发布者的 URL

func (*LiveQuery) HasLiveQuery

func (l *LiveQuery) HasLiveQuery(className string) bool

HasLiveQuery 是否有对应的 className

func (*LiveQuery) OnAfterDelete

func (l *LiveQuery) OnAfterDelete(className string, currentObject, originalObject map[string]interface{})

OnAfterDelete 删除对象之后调用

func (*LiveQuery) OnAfterSave

func (l *LiveQuery) OnAfterSave(className string, currentObject, originalObject map[string]interface{})

OnAfterSave 保存对象之后调用

Directories

Path Synopsis
t

Jump to

Keyboard shortcuts

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