mongo-driver: go.mongodb.org/mongo-driver/x/mongo/driver/drivertest Index | Files

package drivertest

import "go.mongodb.org/mongo-driver/x/mongo/driver/drivertest"

Index

Package Files

channel_conn.go channel_netconn.go

func MakeReply Uses

func MakeReply(doc bsoncore.Document) []byte

MakeReply creates an OP_REPLY wiremessage from a BSON document

type ChannelConn Uses

type ChannelConn struct {
    WriteErr error
    Written  chan []byte
    ReadResp chan []byte
    ReadErr  chan error
    Desc     description.Server
}

ChannelConn implements the driver.Connection interface by reading and writing wire messages to a channel

func (*ChannelConn) Address Uses

func (c *ChannelConn) Address() address.Address

Address implements the driver.Connection interface.

func (*ChannelConn) Close Uses

func (c *ChannelConn) Close() error

Close implements the driver.Connection interface.

func (*ChannelConn) Description Uses

func (c *ChannelConn) Description() description.Server

Description implements the driver.Connection interface.

func (*ChannelConn) ID Uses

func (c *ChannelConn) ID() string

ID implements the driver.Connection interface.

func (*ChannelConn) ReadWireMessage Uses

func (c *ChannelConn) ReadWireMessage(ctx context.Context, dst []byte) ([]byte, error)

ReadWireMessage implements the driver.Connection interface.

func (*ChannelConn) WriteWireMessage Uses

func (c *ChannelConn) WriteWireMessage(ctx context.Context, wm []byte) error

WriteWireMessage implements the driver.Connection interface.

type ChannelNetConn Uses

type ChannelNetConn struct {
    WriteErr error
    Written  chan []byte
    ReadResp chan []byte
    ReadErr  chan error
}

ChannelNetConn implements the net.Conn interface by reading and writing wire messages to a channel.

func (*ChannelNetConn) AddResponse Uses

func (c *ChannelNetConn) AddResponse(resp []byte) error

AddResponse adds a response to the connection.

func (*ChannelNetConn) Close Uses

func (c *ChannelNetConn) Close() error

Close closes the connection.

func (*ChannelNetConn) GetWrittenMessage Uses

func (c *ChannelNetConn) GetWrittenMessage() []byte

GetWrittenMessage gets the last wire message written to the connection

func (*ChannelNetConn) LocalAddr Uses

func (c *ChannelNetConn) LocalAddr() net.Addr

LocalAddr returns the local network address.

func (*ChannelNetConn) Read Uses

func (c *ChannelNetConn) Read(b []byte) (int, error)

Read reads data from the connection

func (*ChannelNetConn) RemoteAddr Uses

func (c *ChannelNetConn) RemoteAddr() net.Addr

RemoteAddr returns the remote network address.

func (*ChannelNetConn) SetDeadline Uses

func (c *ChannelNetConn) SetDeadline(_ time.Time) error

SetDeadline sets the read and write deadlines associated with the connection.

func (*ChannelNetConn) SetReadDeadline Uses

func (c *ChannelNetConn) SetReadDeadline(_ time.Time) error

SetReadDeadline sets the read and write deadlines associated with the connection.

func (*ChannelNetConn) SetWriteDeadline Uses

func (c *ChannelNetConn) SetWriteDeadline(_ time.Time) error

SetWriteDeadline sets the read and write deadlines associated with the connection.

func (*ChannelNetConn) Write Uses

func (c *ChannelNetConn) Write(b []byte) (int, error)

Write writes data to the connection.

Package drivertest imports 8 packages (graph). Updated 2019-07-08. Refresh now. Tools for package owners.