ws

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: May 13, 2020 License: Apache-2.0 Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewBroker

func NewBroker(router *auramq.Router, addr string, auth bool, authFunc func(*msg.AuthReq) bool, subscriberBufferSize, readBufferSize, writeBufferSize, pingWait, readWait, writeWait int) auramq.Broker

NewBroker create new websocket broker

func NewWsSubscriber

func NewWsSubscriber(router *auramq.Router, conn *websocket.Conn, subscriberBufferSize, pingWait, readWait, writeWait int) auramq.Subscriber

NewWsSubscriber create a new websocket subscriber

Types

type Broker

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

Broker websocket broker

func (*Broker) Auth

func (broker *Broker) Auth(authMsg *msg.AuthReq) bool

Auth authencate when subscribing

func (*Broker) Close

func (broker *Broker) Close()

Close close http server

func (*Broker) NeedAuth

func (broker *Broker) NeedAuth() bool

NeedAuth if need auth when subscribe

func (*Broker) Run

func (broker *Broker) Run()

Run start websocket broker

type WsSubscriber

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

WsSubscriber subscriber for websocket broker

func (*WsSubscriber) Close

func (s *WsSubscriber) Close()

Close close subscriber

func (*WsSubscriber) Run

func (s *WsSubscriber) Run()

Run start subscriber

func (*WsSubscriber) Send

func (s *WsSubscriber) Send(msg *msg.Message) bool

Send send message

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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