Documentation
¶
Index ¶
- type StubRelay
- func (s *StubRelay) Close()
- func (s *StubRelay) Received() []*protocol.Envelope
- func (s *StubRelay) Send(payload any) error
- func (s *StubRelay) URL() string
- func (s *StubRelay) WaitForConnection(timeout time.Duration) error
- func (s *StubRelay) WaitForFrame(msgType string, timeout time.Duration) (*protocol.Envelope, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type StubRelay ¶
type StubRelay struct {
// contains filtered or unexported fields
}
StubRelay is an in-process fake relay for daemon integration tests. It upgrades a WebSocket, records received frames, and lets the test enqueue frames to send to the connected daemon.
func NewStubRelay ¶
NewStubRelay starts a stub relay on a random local port.
func (*StubRelay) Close ¶
func (s *StubRelay) Close()
Close shuts down the underlying httptest server.
func (*StubRelay) Send ¶
Send enqueues a payload to be written to the connected daemon. The payload is marshaled with encoding/json and sent as a single text frame; callers pass concrete protocol message structs (e.g. *protocol.Welcome) directly.
func (*StubRelay) WaitForConnection ¶
WaitForConnection blocks until a daemon connects, or returns an error on timeout.
Click to show internal directories.
Click to hide internal directories.