Documentation
¶
Index ¶
- Constants
- Variables
- func AppendHeader(dst []byte, h Header) []byte
- func AppendMessage(dst []byte, requestID, responseTo int32, opCode OpCode, body []byte) ([]byte, error)
- func AppendMsgBody(dst []byte, flags MsgFlag, doc Document) ([]byte, error)
- func AppendMsgBodyWithSequences(dst []byte, flags MsgFlag, doc Document, sequences []DocumentSequence) ([]byte, error)
- func AppendMsgMessage(dst []byte, requestID, responseTo int32, flags MsgFlag, doc Document) ([]byte, error)
- func AppendMsgMessageWithSequences(dst []byte, requestID, responseTo int32, flags MsgFlag, doc Document, ...) ([]byte, error)
- func AppendQueryBody(dst []byte, flags int32, fullCollectionName string, ...) ([]byte, error)
- func AppendQueryMessage(dst []byte, requestID, responseTo int32, flags int32, ...) ([]byte, error)
- func AppendReplyBody(dst []byte, responseFlags int32, cursorID int64, startingFrom int32, ...) ([]byte, error)
- func AppendReplyMessage(dst []byte, requestID, responseTo int32, responseFlags int32, cursorID int64, ...) ([]byte, error)
- func CommandName(doc Document) (string, error)
- func CommandNameFromValidatedDocument(doc Document) (string, error)
- func ValidateDocument(doc Document) error
- type Document
- type DocumentSequence
- type Header
- type Msg
- type MsgFlag
- type OpCode
- type Query
- type Reply
Constants ¶
View Source
const ( HeaderLen = 16 DefaultMaxMessageLength = 48_000_000 )
View Source
const ( MsgSectionBody byte = 0 MsgSectionDocumentSequence byte = 1 )
Variables ¶
Functions ¶
func AppendHeader ¶
func AppendMessage ¶
func AppendMsgMessage ¶
func AppendQueryBody ¶
func AppendQueryMessage ¶
func AppendReplyBody ¶
func AppendReplyMessage ¶
func CommandName ¶
func CommandNameFromValidatedDocument ¶
CommandNameFromValidatedDocument extracts the command name from a document that has already passed ValidateDocument, such as a ParseMsg or ParseQuery result.
func ValidateDocument ¶
Types ¶
type DocumentSequence ¶
type Header ¶
func ParseHeader ¶
func ReadMessageInto ¶
ReadMessageInto reads one wire message and uses dst as reusable storage for the returned body when dst has enough capacity. Callers that pass a reusable dst must treat the returned body as borrowed: it may alias dst and remains valid only until dst is reused or modified. Clone the body before retaining it across subsequent reads.
type Msg ¶
type Msg struct {
Flags MsgFlag
Body Document
Sequences []DocumentSequence
}
Click to show internal directories.
Click to hide internal directories.