ssehandler

package module
v0.0.0-...-649b191 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2021 License: MIT Imports: 5 Imported by: 1

README

HTML5 Server-Side Events handler for Gin.

Status: Unmaintained

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SSEHandler

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

func NewSSEHandler

func NewSSEHandler() *SSEHandler

Make a new SSEHandler instance.

func (*SSEHandler) HandleEvents

func (b *SSEHandler) HandleEvents()

Start handling new and disconnected clients, as well as sending messages to all connected clients.

func (*SSEHandler) SendJSON

func (b *SSEHandler) SendJSON(obj interface{})

Send out a JSON string object to all clients.

func (*SSEHandler) SendString

func (b *SSEHandler) SendString(msg string)

Send out a simple string to all clients.

func (*SSEHandler) Subscribe

func (b *SSEHandler) Subscribe(c *gin.Context)

Subscribe a new client and start sending out messages to it.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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