interop

package
v0.0.0-...-b4e0e05 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ENGINE_EVENT      string = "engine"
	GAME_CLIENT_EVENT string = "game_client"
	SETTINGS_EVENT    string = "settings"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ActiveProfileUiEvent

type ActiveProfileUiEvent struct {
	EventType      string
	Action         string // actions: replace
	ActiveProfiles []*multibox.ActiveProfile
}

events outgoing to UI

func NewActiveProfileUiEvent

func NewActiveProfileUiEvent() *ActiveProfileUiEvent

type ActiveProfileUiEventDispatcher

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

func NewActiveProfileUiEventDispatcher

func NewActiveProfileUiEventDispatcher(
	logger log.Logger,
	interopWriteAdapter ports.InteropWriter,
) *ActiveProfileUiEventDispatcher

func (*ActiveProfileUiEventDispatcher) Replace

func (d *ActiveProfileUiEventDispatcher) Replace(activeProfiles []*multibox.ActiveProfile)

type Connection

type Connection struct {
	Id   int
	Conn *websocket.Conn
}

func NewConnection

func NewConnection() *Connection

type ConnectionPool

type ConnectionPool struct {
	Connections []*websocket.Conn
}

func NewConnectionPool

func NewConnectionPool() *ConnectionPool

func (*ConnectionPool) Add

func (p *ConnectionPool) Add(c *websocket.Conn, m *sync.Mutex) (err error)

func (*ConnectionPool) Remove

func (p *ConnectionPool) Remove(c *websocket.Conn, m *sync.Mutex) (err error)

type EventRouter

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

func NewEventRouter

func NewEventRouter(
	logger log.Logger,
	defaultHandler *handler.DefaultLogger,
	engineEventHandler *handler.Engine,
	gameClientEventHandler *handler.GameClient,
	viewManagerEventHandler *handler.Settings,
) *EventRouter

func (*EventRouter) Route

func (er *EventRouter) Route(event []byte, response chan []byte) (err error)

match the event to its handler

type Server

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

server for handling websocket connections from a UI

func NewServer

func NewServer(logger log.Logger, router ports.MessageRouter, cfg ports.Settings) *Server

func (*Server) StartIO

func (s *Server) StartIO()

func (*Server) Write

func (s *Server) Write(message []byte)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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