server

package
v0.10.1 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2019 License: Apache-2.0 Imports: 12 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
}

func (FanOutAction) Empty added in v0.8.2

func (a FanOutAction) Empty() bool

type RemoveFanAction added in v0.8.5

type RemoveFanAction 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(version model.WebVersion) *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 SailServer

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

func ProvideSailServer

func ProvideSailServer(assetServer assets.Server) 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