Documentation ¶
Overview ¶
package drpcwire provides low level helpers for the drpc wire protocol.
Index ¶
- func AppendFrame(buf []byte, fr Frame) []byte
- func AppendVarint(buf []byte, x uint64) []byte
- func MarshalError(err error) []byte
- func ReadVarint(buf []byte) (rem []byte, out uint64, ok bool, err error)
- func SplitFrame(data []byte, atEOF bool) (int, []byte, error)
- func SplitN(pkt Packet, n int, cb func(fr Frame) error) error
- func UnmarshalError(data []byte) error
- type Frame
- type ID
- type Kind
- type Packet
- type Reader
- type Writer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AppendFrame ¶
func AppendVarint ¶
AppendVarint appends the varint encoding of x to the buffer and returns it.
func MarshalError ¶
MarshalError returns a byte form of the error with any error code incorporated.
func ReadVarint ¶
ReadVarint reads a varint encoded integer from the front of buf, returning the remaining bytes, the value, and if there was a success. if ok is false, the returned buffer is the same as the passed in buffer.
func UnmarshalError ¶
UnmarshalError unmarshals the marshaled error to one with a code.
Types ¶
type Reader ¶
type Reader struct {
// contains filtered or unexported fields
}
func (*Reader) ReadPacket ¶
type Writer ¶
type Writer struct {
// contains filtered or unexported fields
}
func (*Writer) WriteFrame ¶
func (*Writer) WritePacket ¶
Click to show internal directories.
Click to hide internal directories.