websocket

package
v0.1.0-alpha Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Conf

type Conf struct {
	Fields      []baker.FieldIndex
	FieldByName func(string) (baker.FieldIndex, bool)
}

Conf holds required configurations that are passed to NewServer to configure the Server

type Server

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

Server represents the websocket server.

func NewServer

func NewServer(c Conf) *Server

NewServer creates new chat server.

func (*Server) Listen

func (s *Server) Listen()

Listen and serve. It serves client connection and broadcast request.

func (*Server) SendAll

func (s *Server) SendAll(msg []string)

SendAll sends a message to all connected clients. Used by the output component to broadcast the message to the clients

Jump to

Keyboard shortcuts

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