websocket

package
v0.0.0-...-701c789 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Upgrade

func Upgrade(w http.ResponseWriter, r *http.Request) (*websocket.Conn, error)

Types

type Client

type Client struct {
	ID            string
	Conn          *websocket.Conn
	Pool          *Pool
	Alias         string
	Subscriptions []*redis.PubSub
}

func (*Client) Read

func (c *Client) Read()

type Message

type Message struct {
	Type string `json:"type"`
	Body string `json:"body"`
}

type Pool

type Pool struct {
	Register   chan *Client
	Unregister chan *Client
	Clients    map[*Client]bool
	Redis      *redis.ClusterClient
	LogEntry   log.Entry
	Wait       *sync.WaitGroup
}

func NewPool

func NewPool(conf config.AppConfig) *Pool

func (*Pool) Start

func (pool *Pool) Start()

Jump to

Keyboard shortcuts

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