Documentation
¶
Index ¶
- type LayoutServer
- func (s *LayoutServer) DrainLayoutUpdates()
- func (s *LayoutServer) GetLayoutModel() *s4wave_layout.LayoutModel
- func (s *LayoutServer) GetPort() int
- func (s *LayoutServer) SetLayoutModel(model *s4wave_layout.LayoutModel)
- func (s *LayoutServer) Start(ctx context.Context) (int, error)
- func (s *LayoutServer) Stop(ctx context.Context) error
- func (s *LayoutServer) WaitForLayoutUpdate(ctx context.Context) (*s4wave_layout.LayoutModel, error)
- func (s *LayoutServer) WaitForNavigateTab(ctx context.Context) (*s4wave_layout.NavigateTabRequest, error)
- type Server
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LayoutServer ¶
type LayoutServer struct {
// contains filtered or unexported fields
}
LayoutServer provides a WebSocket-based RPC server for browser layout E2E tests. It exposes a LayoutHost service that can be connected to from browser tests.
func NewLayoutServer ¶
func NewLayoutServer(le *logrus.Entry) *LayoutServer
NewLayoutServer creates a new LayoutServer.
func (*LayoutServer) DrainLayoutUpdates ¶
func (s *LayoutServer) DrainLayoutUpdates()
DrainLayoutUpdates drains any pending layout updates.
func (*LayoutServer) GetLayoutModel ¶
func (s *LayoutServer) GetLayoutModel() *s4wave_layout.LayoutModel
GetLayoutModel returns the current layout model.
func (*LayoutServer) GetPort ¶
func (s *LayoutServer) GetPort() int
GetPort returns the port the server is listening on, or 0 if not running.
func (*LayoutServer) SetLayoutModel ¶
func (s *LayoutServer) SetLayoutModel(model *s4wave_layout.LayoutModel)
SetLayoutModel sets the current layout model (server-initiated). This will be streamed to connected clients via WatchLayoutModel.
func (*LayoutServer) Start ¶
func (s *LayoutServer) Start(ctx context.Context) (int, error)
Start starts the WebSocket server on a random available port. Returns the port number the server is listening on.
func (*LayoutServer) Stop ¶
func (s *LayoutServer) Stop(ctx context.Context) error
Stop stops the server.
func (*LayoutServer) WaitForLayoutUpdate ¶
func (s *LayoutServer) WaitForLayoutUpdate(ctx context.Context) (*s4wave_layout.LayoutModel, error)
WaitForLayoutUpdate waits for the frontend to push a layout update. Returns the updated model or an error if ctx is canceled.
func (*LayoutServer) WaitForNavigateTab ¶
func (s *LayoutServer) WaitForNavigateTab(ctx context.Context) (*s4wave_layout.NavigateTabRequest, error)
WaitForNavigateTab waits for the frontend to navigate within a tab. Returns the navigate request or an error if ctx is canceled.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server provides a WebSocket-based RPC server for browser E2E tests. It exposes an srpc.Mux over WebSocket for browser clients.