daemon

package
v0.0.0-...-709aae2 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2026 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EventType

type EventType string

EventType categorizes the stream events

const (
	EventNetworkRequest EventType = "network_request"
	EventConsole        EventType = "console"
	EventOverflow       EventType = "overflow_warning"
)

type RecordedEvent

type RecordedEvent struct {
	T      int64                  `json:"t"`
	Action string                 `json:"action"`
	Params map[string]interface{} `json:"params,omitempty"`
}

RecordedEvent represents a single captured action.

type Server

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

Server holds the state for the running browser daemon.

func NewServer

func NewServer(port int, mode string) *Server

NewServer creates a new Daemon configuration.

func (*Server) HandleSignals

func (s *Server) HandleSignals()

HandleSignals listens for SIGINT/SIGTERM and cleanly stops the daemon. This ensures Chrome is killed even if the parent script is Ctrl+C'd.

func (*Server) Start

func (s *Server) Start() error

Start visualizes the browser based on mode and boots the local API server.

func (*Server) Stop

func (s *Server) Stop()

Stop gracefully closes the browser and the HTTP server.

type StreamEvent

type StreamEvent struct {
	Type    EventType   `json:"type"`
	Payload interface{} `json:"payload,omitempty"`
}

StreamEvent is the JSON payload sent over SSE

Jump to

Keyboard shortcuts

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