realtime

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ERR_NOT_CONNECT_WS   = "Not connect to the websocket"
	ERR_INVALID_ID       = "Invalid id"
	ERR_INVALID_NAME     = "Invalid name"
	MSG_RT_HOST_REQUIRED = "RT_HOST required"
	MSG_RT_AUTH_REQUIRED = "RT_AUTH required"
)
View Source
const ServiceName = "Real Time"

Variables

This section is empty.

Functions

func Close

func Close()

* * Close *

func Data

func Data(channel string, data et.Json) error

* * Data * @param string channel * @param func(Message) reciveFn * @return error *

func From

func From() et.Json

* * From * @return et.Json *

func HttpEventWork

func HttpEventWork(w http.ResponseWriter, r *http.Request)

* * HttpEventWork * @param w http.ResponseWriter * @param r *http.Request *

func Load

func Load() (*ws.Client, error)

* * Load * @return erro *

func Log

func Log(event string, data et.Json)

* * Log * @param event string * @param data et.Json *

func Overflow

func Overflow(data et.Json)

* * Overflow * @param data et.Json *

func Ping

func Ping()

* * Ping *

func Publish

func Publish(channel string, message interface{}) error

* * Publish a message to a channel * @param channel string * @param message interface{} *

func Queue

func Queue(channel, queue string, reciveFn func(ws.Message))

* * Queue to a channel * @param channel string * @param reciveFn func(message.ws.Message) *

func SendMessage

func SendMessage(clientId string, message interface{}) error

* * SendMessage * @param clientId string * @param message interface{} * @return error *

func SetDirectMessageCallback

func SetDirectMessageCallback(reciveFn func(ws.Message))

* * SetDirectMessageCallback * @param reciveFn func(ws.Message) *

func SetFrom

func SetFrom(name string) error

* * SetFrom * @param params et.Json * @return error *

func SetReconnectCallback

func SetReconnectCallback(reciveFn func(c *ws.Client))

* * SetReconnectCallback * @param reciveFn func(ws.Client) *

func Source

func Source(channel string, reciveFn func(ws.Message)) error

* * Source * @param string channel * @param func(Message) reciveFn * @return error *

func Stack

func Stack(channel string, reciveFn func(ws.Message))

* * Stack to a channel * @param channel string * @param reciveFn func(message.ws.Message) *

func Subscribe

func Subscribe(channel string, reciveFn func(ws.Message)) error

* * Subscribe to a channel * @param channel string * @param reciveFn func(message.ws.Message) *

func Telemetry

func Telemetry(data et.Json)

* * Telemetry * @param data et.Json *

func TokenLastUse

func TokenLastUse(data et.Json)

* * TokenLastUse * @param data et.Json *

func Unsubscribe

func Unsubscribe(channel string)

* * Unsubscribe to a channel * @param channel string *

func Work

func Work(event string, data et.Json) et.Json

* * Work * @param event string * @param data et.Json *

func WorkState

func WorkState(work_id string, status event.WorkStatus, data et.Json)

* * WorkState * @param work_id string * @param status WorkStatus * @param data et.Json *

Types

This section is empty.

Jump to

Keyboard shortcuts

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