Documentation
¶
Overview ¶
Package control is the bridge's control channel: a per-session local socket (or named pipe on Windows) the daemon hub accepts on and the bridge dials.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ScanEvents ¶
ScanEvents reads JSON-line events from r, calling fn for each. A blank line is skipped; a line starting with '{' MUST parse as a JSON Event or it is a protocol error (returned, not surfaced as a pick); a non-'{' line is treated as the legacy bare pick value and surfaced as Event{T:"pick", Value:line} for back-compat. It returns the first fn error, a malformed-line error, or a read error other than io.EOF.
func SocketPath ¶
Types ¶
type Acceptor ¶
type Acceptor struct {
// contains filtered or unexported fields
}
Acceptor listens on a control socket and yields one persistent Conn per dialing bridge, keeping each connection open for the session's life.
func Accept ¶
Accept binds the control socket at path (removing a stale socket first) and starts accepting bridge connections. Each appears on Conns().
type Conn ¶
type Conn struct {
// contains filtered or unexported fields
}
Conn is a persistent bidirectional event connection over a net.Conn. The daemon (hub) accepts one per supervised bridge; the bridge dials. Each direction is an independent stream of JSON-line Events. Write is safe for concurrent callers (serialized by mu); Scan must be called from a single goroutine.
func Dial ¶
Dial connects to the hub's control socket, returning a persistent Conn. The bridge calls this at startup and again on each reconnect.
func (*Conn) Emit ¶
Emit satisfies contracts.EventSink so the bridge can hand a Conn directly to its turn loop as the event sink. A write error is dropped: emission is best-effort and the hub's read side detects a dead conn independently.