server

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2021 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateWebsocketHandlerFunc

func GenerateWebsocketHandlerFunc(handler WebsocketHandler) gin.HandlerFunc

func GetAssetsPath

func GetAssetsPath() string

func Router

func Router() *gin.Engine

func Run

func Run() error

func Shutdown

func Shutdown() error

Types

type Websocket

type Websocket interface {
	Socket() *websocket.Conn
	Context() *gin.Context
	WriteMessage(message []byte) error
	WriteBytes(bytes []byte) error
	Close() error
}

type WebsocketHandler

type WebsocketHandler interface {
	NewConnection(socket Websocket)
	Disconnected(socket Websocket)
	ReadMessage(socket Websocket, message []byte)
	ReadBytes(socket Websocket, bytes []byte)
}

Jump to

Keyboard shortcuts

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