Documentation
¶
Overview ¶
Package msg is not for public use.
The API for packages in the 'private' directory have no stability guarantee.
The packages within the 'private' directory would normally be put into an 'internal' directory to prohibit their use outside the 'mongo' directory. However, some MongoDB tools require very low-level access to the building blocks of a driver, so we have placed them under 'private' to allow these packages to be imported by projects that need them.
These package APIs may be modified in backwards-incompatible ways at any time.
You are strongly discouraged from directly using any packages under 'private'.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Codec ¶
Codec encodes and decodes messages.
func NewWireProtocolCodec ¶
func NewWireProtocolCodec() Codec
NewWireProtocolCodec creates a MessageReadWriter for the binary message format.
type Decoder ¶
type Decoder interface {
// Decode decodes one message from the reader.
Decode(io.Reader) (Message, error)
}
Decoder decodes messages.
type Encoder ¶
type Encoder interface {
// Encode encodes a number of messages to the writer.
Encode(io.Writer, ...Message) error
}
Encoder encodes messages.
type Message ¶
type Message interface {
// contains filtered or unexported methods
}
Message represents a MongoDB message.
type Query ¶
type Query struct {
ReqID int32
Flags QueryFlags
FullCollectionName string
NumberToSkip int32
NumberToReturn int32
Query interface{}
ReturnFieldsSelector interface{}
}
Query is a message sent to the server.
type QueryFlags ¶
type QueryFlags int32
QueryFlags are the flags in a Query.
const ( TailableCursor QueryFlags SlaveOK OplogReplay NoCursorTimeout AwaitData Exhaust Partial )
QueryFlags constants.
type Reply ¶
type Reply struct {
ReqID int32
RespTo int32
ResponseFlags ReplyFlags
CursorID int64
StartingFrom int32
NumberReturned int32
DocumentsBytes []byte
}
Reply is a message received from the server.
func (*Reply) ResponseTo ¶
ResponseTo gets the request id the message was in response to.
type ReplyFlags ¶
type ReplyFlags int32
ReplyFlags are the flags in a Reply.
const ( CursorNotFound ReplyFlags = 1 << iota QueryFailure AwaitCapable )
ReplayMessageFlags constants.
type ReplyIter ¶
type ReplyIter struct {
// contains filtered or unexported fields
}
ReplyIter iterates over the documents returned in a Reply.