overlord

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 28, 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 BrowserClient

type BrowserClient struct {
	*cws.Client
}

func NewBrowserClient

func NewBrowserClient(c *websocket.Conn) *BrowserClient

NewOverlordClient returns a client connecting to browser. This connection exchanges information between clients and server

type Server

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

func NewServer

func NewServer() *Server

func (*Server) GetWeb

func (o *Server) GetWeb(w http.ResponseWriter, r *http.Request)

GetWeb returns web frontend

func (*Server) RouteWorker

func (o *Server) RouteWorker(workerClient *WorkerClient)

RouteWorker are all routes server received from worker

func (*Server) WS

func (o *Server) WS(w http.ResponseWriter, r *http.Request)

WSO handles all connections from frontend to overlord

func (*Server) WSO

func (o *Server) WSO(w http.ResponseWriter, r *http.Request)

WSO handles all connections from a new worker to overlord

type Session

type Session struct {
	ID            string
	BrowserClient *BrowserClient
	WorkerClient  *WorkerClient

	ServerID string
	RoomID   string
	// contains filtered or unexported fields
}

Session represents a session connected from the browser to the current server It requires one connection to browser and one connection to the overlord connection to browser is 1-1. connection to overlord is n - 1 Peerconnection can be from other server to ensure better latency

func (*Session) RouteBrowser

func (s *Session) RouteBrowser()

RouteBrowser are all routes server accepts for browser

type WorkerClient

type WorkerClient struct {
	*cws.Client
	ServerID string
}

func NewWorkerClient

func NewWorkerClient(c *websocket.Conn, serverID string) *WorkerClient

NewWorkerClient returns a client connecting to worker. This connection exchanges information between workers and server

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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