websocket

package
v0.7.4 Latest Latest
Warning

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

Go to latest
Published: May 3, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BufferSize = 100
View Source
var ErrNoErrorHandled = errors.New("handled")
View Source
var ErrNotImplemented = errors.New("operation not implemented")

Functions

func Dial

func Dial[T any](url *url.URL, ctx context.Context) (readerOut <-chan T, writerOut chan<- Write[T], err error)

func Serve

func Serve[T any](r *gin.RouterGroup, path string, acceptFunc func(c *gin.Context) bool, wsfunc WSHandler[T])

Types

type WSHandler

type WSHandler[T any] func(<-chan T, chan<- Write[T], gin.Params, context.Context)

type Write

type Write[T any] struct {
	Data T            `json:"data"`
	Err  chan<- error `json:"err"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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