Versions in this module Expand all Collapse all v1 v1.0.2 May 4, 2023 v1.0.1 May 4, 2023 Changes in this version type Conn + func (conn *Conn) SetSpanContext(span tracer.SpanContext) + func (conn *Conn) SpanContext() tracer.SpanContext v1.0.0 May 3, 2023 Changes in this version type Server + func (server *Server) GetAddress() string + func (server *Server) SetAddress(addr string) v0 v0.9.5 Apr 23, 2023 Changes in this version type Server + func (server *Server) SetTracer(t tracer.Tracer) v0.9.4 Apr 8, 2023 v0.9.3 Apr 1, 2023 Changes in this version + const PackageName v0.9.2 Mar 28, 2023 Changes in this version type CommandExecutor + ExecuteCommand func(cmd *Command) (bson.Document, error) + type Conn struct + func (conn *Conn) Timestamp() time.Time + type QueryCommandExecutor interface + Delete func(*Conn, *Query) (int32, error) + Find func(*Conn, *Query) ([]bson.Document, error) + Insert func(*Conn, *Query) (int32, error) + Update func(*Conn, *Query) (int32, error) v0.9.1 Feb 24, 2023 Changes in this version + var ErrQuery = errors.New("query error") + var ErrQueryNotSupported = errors.New("query not supported") + func NewNotSupported(q *Query) error + func NewQueryError(q *Query) error v0.9.0 Aug 1, 2022 Changes in this version + const DefaultHost + const DefaultPort + const DefaultTimeoutSecond + const Version + type BaseCommandExecutor struct + func NewBaseCommandExecutor() *BaseCommandExecutor + func (executor *BaseCommandExecutor) Delete(q *Query) (int32, bool) + func (executor *BaseCommandExecutor) ExecuteBuildInfo(cmd *Command) (bson.Document, error) + func (executor *BaseCommandExecutor) ExecuteCommand(cmd *Command) (bson.Document, error) + func (executor *BaseCommandExecutor) ExecuteGetLastError(cmd *Command) (bson.Document, error) + func (executor *BaseCommandExecutor) ExecuteIsMaster(cmd *Command) (bson.Document, error) + func (executor *BaseCommandExecutor) Find(q *Query) ([]bson.Document, bool) + func (executor *BaseCommandExecutor) Insert(q *Query) (int32, bool) + func (executor *BaseCommandExecutor) SetDatabaseCommandExecutor(fn DatabaseCommandExecutor) + func (executor *BaseCommandExecutor) SetUserCommandExecutor(fn UserCommandExecutor) + func (executor *BaseCommandExecutor) Update(q *Query) (int32, bool) + type BaseMessageHandler struct + func NewBaseMessageHandler() *BaseMessageHandler + func (handler *BaseMessageHandler) OpDelete(msg *OpDelete) (bson.Document, error) + func (handler *BaseMessageHandler) OpGetMore(msg *OpGetMore) (bson.Document, error) + func (handler *BaseMessageHandler) OpInsert(msg *OpInsert) (bson.Document, error) + func (handler *BaseMessageHandler) OpKillCursors(msg *OpKillCursors) (bson.Document, error) + func (handler *BaseMessageHandler) OpMsg(msg *OpMsg) (bson.Document, error) + func (handler *BaseMessageHandler) OpQuery(msg *OpQuery) (bson.Document, error) + func (handler *BaseMessageHandler) OpUpdate(msg *OpUpdate) (bson.Document, error) + func (handler *BaseMessageHandler) SetCommandExecutor(fn CommandExecutor) + func (handler *BaseMessageHandler) SetMessageExecutor(fn MessageExecutor) + type Client struct + Collection string + Database string + Host string + Port int + Timeout time.Duration + func NewClient() *Client + func (client *Client) Close() error + func (client *Client) Connect() error + func (client *Client) GetCollection() string + func (client *Client) GetDatabase() string + func (client *Client) GetHost() string + func (client *Client) GetPort() int + func (client *Client) GetTimeout() time.Duration + func (client *Client) InsertOne(doc interface{}) error + func (client *Client) SetCollection(col string) + func (client *Client) SetDatabase(db string) + func (client *Client) SetHost(host string) + func (client *Client) SetPort(port int) + func (client *Client) SetTimeout(d time.Duration) + type Command = message.Command + type CommandExecutor interface + type Config struct + func NewDefaultConfig() *Config + func (config *Config) GetCompressions() []string + func (config *Config) GetLogicalSessionTimeoutMinutes() int32 + func (config *Config) GetMaxBsonObjectSize() int32 + func (config *Config) GetMaxMessageSizeBytes() int32 + func (config *Config) GetMaxWireVersion() int32 + func (config *Config) GetMaxWriteBatchSize() int32 + func (config *Config) GetMinWireVersion() int32 + func (config *Config) GetReadOnly() bool + func (config *Config) GetVersion() string + func (config *Config) IsMaster() bool + type DatabaseCommandExecutor interface + type DiagnosticCommandExecutor interface + ExecuteBuildInfo func(cmd *Command) (bson.Document, error) + type Document = bsoncore.Document + type MessageExecutor interface + type MessageListener interface + type OpDelete = protocol.Delete + type OpFlag = protocol.Flag + type OpGetMore = protocol.GetMore + type OpInsert = protocol.Insert + type OpKillCursors = protocol.KillCursors + type OpMessage = protocol.Message + type OpMessageHandler interface + OpDelete func(q *OpDelete) (bson.Document, error) + OpGetMore func(q *OpGetMore) (bson.Document, error) + OpInsert func(q *OpInsert) (bson.Document, error) + OpKillCursors func(q *OpKillCursors) (bson.Document, error) + OpMsg func(q *OpMsg) (bson.Document, error) + OpQuery func(q *OpQuery) (bson.Document, error) + OpUpdate func(q *OpUpdate) (bson.Document, error) + type OpMsg = protocol.Msg + type OpQuery = protocol.Query + type OpReply = protocol.Reply + type OpUpdate = protocol.Update + type Query = message.Query + type ReplicationCommandExecutor interface + ExecuteIsMaster func(cmd *Command) (bson.Document, error) + type Server struct + Addr string + MessageHandler OpMessageHandler + Port int + func NewServer() *Server + func (server *Server) ExecuteBuildInfo(cmd *Command) (bson.Document, error) + func (server *Server) ExecuteIsMaster(cmd *Command) (bson.Document, error) + func (server *Server) GetPort() int + func (server *Server) Restart() error + func (server *Server) SetMessageHandler(h OpMessageHandler) + func (server *Server) SetMessageListener(l MessageListener) + func (server *Server) SetPort(port int) + func (server *Server) Start() error + func (server *Server) Stop() error + type UserCommandExecutor interface + type WriteOperationExecutor interface + ExecuteGetLastError func(cmd *Command) (bson.Document, error)