Documentation
¶
Overview ¶
Package workbench serves the local browser debug workbench.
Index ¶
Constants ¶
View Source
const ( DefaultPort = 8585 DefaultAddress = "127.0.0.1:8585" )
Default server limits keep the workbench local and bound resource use.
View Source
const ProtocolVersion = 1
ProtocolVersion identifies the JSON envelope contract spoken by the browser and server.
Variables ¶
View Source
var ( // ErrInvalidConfig indicates that server configuration violates safety constraints. ErrInvalidConfig = errors.New("invalid debug workbench configuration") // ErrAlreadyStarted indicates that Start was called more than once. ErrAlreadyStarted = errors.New("debug workbench server already started") // ErrNotStarted indicates that shutdown was requested before startup. ErrNotStarted = errors.New("debug workbench server not started") // ErrOutboundQueueFull indicates that a slow client exhausted its bounded queue. ErrOutboundQueueFull = errors.New("debug workbench outbound queue is full") // ErrControllerConnected indicates that the initial single-controller limit was reached. ErrControllerConnected = errors.New("a debug workbench controller is already connected") // ErrServerStopping indicates that shutdown has closed the connection admission gate. ErrServerStopping = errors.New("debug workbench server is stopping") )
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Address string
OutboundCapacity int
MaxMessageBytes int64
ResultPoll time.Duration
}
Config controls the local workbench server without exposing gameplay settings.
func DefaultConfig ¶
func DefaultConfig() Config
DefaultConfig returns conservative loopback-only server settings.
type ControlPlane ¶
type ControlPlane interface {
SubmitDebugRequest(request debugging.Request) error
NextDebugResult() (debugging.Result, bool)
DebugDiscoverySnapshot() debugging.DiscoverySnapshot
DebugSceneGeneration() uint64
}
ControlPlane is the concurrency-safe application boundary used by the server.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server owns the loopback listener, active browser connection, and resumable operation records.
func NewServer ¶
func NewServer(control ControlPlane, config Config) (*Server, error)
NewServer validates configuration and creates a stopped workbench server.
Click to show internal directories.
Click to hide internal directories.