server

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2019 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddFanAction

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

type FanConn

type FanConn interface {
	WriteMessage(int, []byte) error
	NextReader() (int, io.Reader, error)
	Close() error
}

A websocket that we only write messages to

type FanOutAction

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

type Room

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

A room where messages from a source are broadcast to all the followers.

func NewRoom

func NewRoom(conn SourceConn) *Room

func (*Room) AddFan

func (r *Room) AddFan(ctx context.Context, conn FanConn)

Add a fan that consumes messages from the source. Calling AddFan() after Close() will error.

func (*Room) Close

func (r *Room) Close()

Only close the room when we know AddFan can't be called.

func (*Room) ConsumeSource

func (r *Room) ConsumeSource(ctx context.Context) error

Receive messages from the source websocket and put them through the state loop.

type RoomID

type RoomID string

type SailServer

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

func ProvideSailServer

func ProvideSailServer(assetServer hudServer.AssetServer) SailServer

func (SailServer) Router

func (s SailServer) Router() http.Handler

type SourceConn

type SourceConn interface {
	ReadMessage() (int, []byte, error)
	Close() error
}

A websocket that we only read messages from

Jump to

Keyboard shortcuts

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