Versions in this module Expand all Collapse all v1 v1.4.3 Feb 9, 2022 Changes in this version type EventRecorder + func NewEventRecorder() *EventRecorder v1.4.2 Jan 31, 2022 v1.4.1 Jan 27, 2022 Changes in this version + const DEFAULT_BUFFER_SIZE + const DEFAULT_TIMEOUT + const UNUSUAL_BUFFER_LENGTH_THRESHOLD + func CreateBarebonesTLSConfig(proto string) (*tls.Config, error) + func MakePipe() (pipe [2]net.Conn) + func NewOnceCloser(c io.Closer) io.Closer + func RunSimpleProtocolSwitch(red, blue net.Conn, redProtocol, blueProtocol Protocol) + type EventRecorder struct + func (this *EventRecorder) AddRecord(e string) bool + func (this *EventRecorder) AssertHappenedBefore(a, b string) + func (this *EventRecorder) HappenedBefore(a, b string) bool + type HTTPProtocol struct + func (this *HTTPProtocol) Pack(buf []byte, out *bufio.Writer) error + func (this *HTTPProtocol) Unpack(in *bufio.Reader) ([]byte, error) + type JsonRPC struct + P Protocol + R *bufio.Reader + W *bufio.Writer + func NewJsonRPC(p Protocol, c io.ReadWriter) *JsonRPC + func (this *JsonRPC) ReadRequest(req interface{}) (err error) + func (this *JsonRPC) Request(req interface{}, resp interface{}) error + func (this *JsonRPC) SendResponse(resp interface{}) (err error) + type LVProtocol struct + func (this *LVProtocol) Pack(buf []byte, out *bufio.Writer) error + func (this *LVProtocol) Unpack(in *bufio.Reader) ([]byte, error) + type OnceCloser struct + func (this *OnceCloser) Close() error + type PackUnpackPassManagerBuilder struct + func NewPackUnpackPassManagerBuilder() *PackUnpackPassManagerBuilder + func (this *PackUnpackPassManagerBuilder) AddPairedPasses(pack Pass, unpack Pass) + func (this *PackUnpackPassManagerBuilder) BuildPackPassManager() *PassManager + func (this *PackUnpackPassManagerBuilder) BuildUnpackPassManager() *PassManager + type Pass interface + RunOnBytes func([]byte) ([]byte, error) + type PassManager struct + func NewPassManager() *PassManager + func NewPassManagerWithPasses(passes []Pass) *PassManager + func (this *PassManager) AddPass(p Pass) *PassManager + func (this *PassManager) RunOnBytes(buf []byte) (result []byte, err error) + type Port struct + C net.Conn + P Protocol + Pack func([]byte) error + Unpack func() ([]byte, error) + func NewPort(c net.Conn, p Protocol) (port *Port) + type Protocol interface + Pack func([]byte, *bufio.Writer) error + Unpack func(*bufio.Reader) ([]byte, error) + type ProtocolStack struct + type ProtocolWithPass struct + P Protocol + PP Pass + UP Pass + func (this *ProtocolWithPass) Pack(src []byte, out *bufio.Writer) (err error) + func (this *ProtocolWithPass) Unpack(in *bufio.Reader) (dst []byte, err error) + type ReadWriterWithTimeout struct + C net.Conn + ReadTimeout time.Duration + WriteTimeout time.Duration + func (this *ReadWriterWithTimeout) Read(b []byte) (int, error) + func (this *ReadWriterWithTimeout) Write(b []byte) (int, error) + type Repeater struct + func (this *Repeater) Pack(buf []byte, out *bufio.Writer) error + func (this *Repeater) Unpack(in *bufio.Reader) ([]byte, error) + type SimpleProtocolSwitch struct + func NewSimpleProtocolSwitch(red, blue net.Conn, redProtocol, blueProtocol Protocol) *SimpleProtocolSwitch + func (this *SimpleProtocolSwitch) Run() + type VariantProtocol struct + func NewVariantProtocol() *VariantProtocol + func (this *VariantProtocol) Add(p Protocol) *VariantProtocol + func (this *VariantProtocol) Len() int + func (this *VariantProtocol) Pack(buf []byte, out *bufio.Writer) error + func (this *VariantProtocol) Unpack(in *bufio.Reader) ([]byte, error)