ws

package module
v0.3.7 Latest Latest
Warning

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

Go to latest
Published: May 7, 2024 License: BSD-3-Clause Imports: 12 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func OptionBuffer added in v0.3.6

func OptionBuffer(read, write int) func(*websocket.Upgrader)

func OptionCompression added in v0.3.6

func OptionCompression(enable bool) func(*websocket.Upgrader)

func WithClient added in v0.3.6

func WithClient() plugins.Plugin

func WithServer added in v0.3.6

func WithServer(options ...func(*websocket.Upgrader)) plugins.Plugin

func WithServerPool added in v0.3.6

func WithServerPool(options ...func(*websocket.Upgrader)) plugins.Plugin

Types

type WebsocketClient

type WebsocketClient interface {
	Create(url string, opts ...func(option client.Option)) WebsocketClientConnect
}

type WebsocketClientConnect

type WebsocketClientConnect interface {
	SendEvent(eid event.Id, in interface{})
	ConnectID() string
	Header(key, value string)
	SetHandler(call client.Handler, eids ...event.Id)
	DelHandler(eids ...event.Id)
	OnClose(cb func(cid string))
	OnOpen(cb func(cid string))
	Close()
}

type WebsocketServer

type WebsocketServer interface {
	Handling(w http.ResponseWriter, r *http.Request)
	SendEvent(eid event.Id, m interface{}, cids ...string)
	Broadcast(eid event.Id, m interface{})
	SetHandler(call server.EventHandler, eids ...event.Id)
	CloseAll()
	CountConn() int
}

type WebsocketServerPool

type WebsocketServerPool interface {
	Create(name string) WebsocketServer
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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