realtime

package
v1.5.1 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Broker

type Broker struct {
	Broadcast chan model.Command
	// contains filtered or unexported fields
}

Broker is used to hold all web socket connections

func NewBroker

func NewBroker(v Validator, pubsub cache.Volatilizer, log *logger.Logger) *Broker

NewBroker returns a ready to use Broker for accepting web socket connections

func (*Broker) Accept

func (b *Broker) Accept(w http.ResponseWriter, r *http.Request)

Accept turns a request into a web socket request and creates a new connection in the Broker

type ConnectionData

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

ConnectionData holds a channel for each web socket connection

type Validator

type Validator func(context.Context, string) (string, error)

Validator validates a session token

Jump to

Keyboard shortcuts

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