Documentation
¶
Overview ¶
Package wire carries NDJSON lines over TCP, TLS and WebSocket behind one interface, and tells protocols apart by the first byte a peer sends.
Index ¶
Constants ¶
const MaxLine = 1 << 20
MaxLine bounds a single incoming line. Envelope parts stay under 512 KiB.
Variables ¶
var ErrLineTooLong = errors.New("line exceeds 1 MiB")
Functions ¶
Types ¶
type BufConn ¶
BufConn is a net.Conn whose first bytes may already sit in a bufio.Reader.
type ChanListener ¶
type ChanListener struct {
// contains filtered or unexported fields
}
ChanListener hands already-accepted connections to an http.Server.
func NewChanListener ¶
func NewChanListener(addr net.Addr) *ChanListener
func (*ChanListener) Addr ¶
func (l *ChanListener) Addr() net.Addr
func (*ChanListener) Close ¶
func (l *ChanListener) Close() error
func (*ChanListener) Push ¶
func (l *ChanListener) Push(c net.Conn)
type LineConn ¶
type LineConn interface {
ReadLine() ([]byte, error)
WriteLine([]byte) error
Close() error
RemoteAddr() string
Transport() string
}
type Pipe ¶
type Pipe struct {
// contains filtered or unexported fields
}
Pipe is an in-memory LineConn pair, used for relay-multiplexed agents and tests.