rt

package
v1.0.34 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 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"
)

Variables

This section is empty.

Functions

func Close

func Close()

* * Close *

func From

func From() et.Json

* * From * @return et.Json *

func IsConnected

func IsConnected() bool

* * IsConnected * @return bool *

func Load

func Load() error

* * ConnectWs connect to the server using the websocket * @param host string * @param scheme string * @param clientId string * @param name string * @return *websocket.Conn * @return error *

func Ping

func Ping()

* * Ping *

func Publish

func Publish(channel string, message interface{})

* * 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 SetFrom

func SetFrom(name string) error

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

func Subscribe

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

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

func Unsubscribe

func Unsubscribe(channel string)

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

Types

type ClientWS

type ClientWS struct {
	Host     string
	ClientId string
	Name     string
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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