server

package
v0.0.0-...-91261df Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2019 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	io.WriteCloser
}

type Server

type Server struct {
	sync.RWMutex
	sync.WaitGroup
	// contains filtered or unexported fields
}

func NewServer

func NewServer(nc *nats.Conn) *Server

func (*Server) Broadcast

func (s *Server) Broadcast(topic string, payload []byte) error

func (*Server) Close

func (s *Server) Close()

func (*Server) Publish

func (s *Server) Publish(topic string, payload []byte) error

func (*Server) RegisterWsClient

func (s *Server) RegisterWsClient(id, topic string, r *http.Request, w http.ResponseWriter) *WsClient

type UnregisterClient

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

type WsClient

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

func (*WsClient) Close

func (wc *WsClient) Close() error

func (*WsClient) Write

func (wc *WsClient) Write(message []byte) (int, error)

Jump to

Keyboard shortcuts

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