Documentation
¶
Overview ¶
Package serve implements the NDJSON JSON-RPC 2.0 framing layer for `repomap serve`. One JSON object per line; no Content-Length headers.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Codec ¶
type Codec struct {
// contains filtered or unexported fields
}
Codec is a single-connection NDJSON framing layer. ReadMessage is NOT safe for concurrent use; it belongs to the read goroutine. WriteMessage is protected by writeMu and is safe for concurrent use.
func NewCodec ¶
NewCodec wraps r and w in an NDJSON codec. The scanner accepts lines up to 4 MB (64 KB initial buffer).
func (*Codec) ReadMessage ¶
ReadMessage reads one JSON-RPC message from the reader. Returns io.EOF when the input stream is exhausted. Not safe for concurrent use.
func (*Codec) WriteMessage ¶
WriteMessage serialises v as a single JSON line. Safe for concurrent use.