Documentation ¶
Index ¶
- Constants
- type BodyMsgSection
- type ConnContext
- type Delete
- type DocumentSequenceMsgSection
- type GetMore
- type Handler
- type Insert
- type KillCursors
- type Msg
- type MsgHeader
- type MsgReply
- type MsgSection
- type OpCode
- type PrintHandler
- type Query
- type QueryHandler
- type Reader
- func (r *Reader) ReadBytes(n int) ([]byte, error)
- func (r *Reader) ReadCString() (string, error)
- func (r *Reader) ReadDocument() (m bson.M, e error)
- func (r *Reader) ReadDocuments() (ms []bson.M, e error)
- func (r *Reader) ReadInt32() (n int32, err error)
- func (r *Reader) ReadInt64() (*int64, error)
- func (r *Reader) ReadOne() ([]byte, error)
- type Reply
- type ResponseFlags
- type Server
- type UnMarshaler
- type Update
- type Writer
Constants ¶
View Source
const CStringEndByte = '\x00'
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BodyMsgSection ¶
func NewBodyMsgSection ¶
func NewBodyMsgSection() *BodyMsgSection
func (*BodyMsgSection) GetKind ¶
func (b *BodyMsgSection) GetKind() byte
type ConnContext ¶
func NewConnContext ¶
func NewConnContext(conn net.Conn) *ConnContext
func (*ConnContext) Get ¶
func (c *ConnContext) Get(key string) (value interface{}, ok bool)
func (*ConnContext) Set ¶
func (c *ConnContext) Set(key string, value interface{})
type Delete ¶
type DocumentSequenceMsgSection ¶
type DocumentSequenceMsgSection struct { Kind byte Size int32 DocumentSequenceIdentifier string DocumentSequences []bson.M }
func NewDocumentSequenceMsgSection ¶
func NewDocumentSequenceMsgSection() *DocumentSequenceMsgSection
func (*DocumentSequenceMsgSection) GetKind ¶
func (d *DocumentSequenceMsgSection) GetKind() byte
type GetMore ¶
type Handler ¶
type Handler interface {
Process(header *MsgHeader, r *Reader, conn *ConnContext) error
}
type Insert ¶
type KillCursors ¶
type KillCursors struct { // standard message header Header MsgHeader // 0 - reserved for future use ZERO int32 // number of cursorIDs in message NumberOfCursorIDs int32 // sequence of cursorIDs to close CursorIDs []int64 }
func (*KillCursors) UnMarshal ¶
func (k *KillCursors) UnMarshal(r *Reader) error
type Msg ¶
type Msg struct { FlatBits uint32 Sections []MsgSection }
func (*Msg) GetBodyMsgSection ¶
type MsgReply ¶
func NewMsgReply ¶
type MsgSection ¶
type MsgSection interface {
GetKind() byte
}
type PrintHandler ¶
type PrintHandler struct { }
func (*PrintHandler) Process ¶
func (d *PrintHandler) Process(header *MsgHeader, r *Reader, conn *ConnContext) error
type Query ¶
type Query struct { // standard message header Header MsgHeader // bit vector of query options. See below for details. Flags int32 // "dbname.collectionname" FullCollectionName string // number of documents to skip NumberToSkip int32 // number of documents to return NumberToReturn int32 // in the first OP_REPLY batch // query object. See below for details. Query bson.M // Optional. Selector indicating the fields ReturnFieldsSelector bson.M }
type QueryHandler ¶
type Reader ¶
func (*Reader) ReadCString ¶
type Reply ¶
type Reply struct { // standard message header Header *MsgHeader // bit vector - see details below ResponseFlags ResponseFlags // cursor id if client needs to do get more's CursorID int64 // where in the cursor this reply is starting StartingFrom int32 // number of documents in the reply NumberReturned int32 // documents Documents interface{} }
func NewErrorReply ¶
type ResponseFlags ¶
type ResponseFlags int32
const ( CursorNotFound ResponseFlags = iota QueryFailure ShardConfigStale AwaitCapable )
type Server ¶
type Server struct { Port string // contains filtered or unexported fields }
func (*Server) AddHandler ¶
func (*Server) GetHandler ¶
func (*Server) SetDefaultHandler ¶
type UnMarshaler ¶
type Update ¶
type Update struct { // standard message header Header MsgHeader // 0 - reserved for future use ZERO int32 // "dbname.collectionname" FullCollectionName string // bit vector. see below Flags int32 // the query to select the document Selector bson.M // specification of the update to perform Update bson.M }
Click to show internal directories.
Click to hide internal directories.