handlers

package
v0.4.6 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewWsHandler

func NewWsHandler(l logger.AppLogger, sendChannel chan Msg, options WsOptions) http.HandlerFunc

Types

type Client

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

type ClientList

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

func (*ClientList) Subscribe

func (cl *ClientList) Subscribe(c *Client)

func (*ClientList) Unsubscribe

func (cl *ClientList) Unsubscribe(id string)

func (*ClientList) Writer

func (cl *ClientList) Writer(ch chan Msg)

type Msg

type Msg struct {
	Kind     string      `json:"kind"`
	Variant  string      `json:"variant,omitempty"`
	Contents interface{} `json:"contents,omitempty"`
}

type WsOptions

type WsOptions struct {
	PingInterval,
	WriteTimeout time.Duration
}

Jump to

Keyboard shortcuts

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