Categorygithub.com/go-playground/ws
modulepackage
0.1.0
Repository: https://github.com/go-playground/ws.git
Documentation: pkg.go.dev

# README

Package ws

Project status Build Status Coverage Status Go Report Card GoDoc License

Package ws creates a hub for WebSocket connections and abstracts away allot of the boilerplate code for managing connections using Gorilla WebSocket. The design of this library was inspired by Dave Cheney's Talk on first Class Functions

Installation

go get -u github.com/go-playground/ws

Examples

Contributing

Make a pull request

Package Versioning

I'm jumping on the vendoring bandwagon, you should vendor this package as I will not be creating different version with gopkg.in like allot of my other libraries.

Why? because my time is spread pretty thin maintaining all of the libraries I have + LIFE, it is so freeing not to worry about it and will help me keep pouring out bigger and better things for you the community.

License

Distributed under MIT License, please see license file in code for more details.

# Packages

No description provided by the author

# Functions

New returns a new websocket hub instance.
NewClient returns a new instance of the default client.

# Structs

Hub is WebSocket hub instance.

# Interfaces

Client is interface for the client type.

# Type aliases

ClientFn is the Client creation function callback.
Connections is a map of Client interfaces to their corresponding WebSocket connection.
ReadFn is the function to be called directly after a read operation by the default client.