Documentation ¶
Index ¶
- Constants
- Variables
- func DecodeBSONDocument(obj document.Object) (bson.Document, error)
- func DecodeBSONValue(obj any) (*bsoncore.Value, error)
- func EncodeBSONDocument(bsonDoc bson.Document) (document.Object, error)
- func EncodeBSONValue(bsonVal bsoncore.Value) (any, error)
- func LookupBSONDocumentObjectID(bsonDoc bson.Document) (any, error)
- func UpdateBSONDocument(doc bson.Document, updateDocs []bson.Document) (bson.Document, error)
- type BSONDecoder
- type BSONEncoder
- type Coder
- type Service
- func (service *Service) Delete(conn *mongo.Conn, q *mongo.Query) (int32, error)
- func (service *Service) Find(conn *mongo.Conn, q *mongo.Query) ([]bson.Document, error)
- func (service *Service) GetDatabase(ctx context.Context, name string) (store.Database, error)
- func (service *Service) Insert(conn *mongo.Conn, q *mongo.Query) (int32, error)
- func (service *Service) MessageReceived(msg mongo.OpMessage)
- func (service *Service) MessageRespond(msg mongo.OpMessage)
- func (service *Service) ServiceName() string
- func (service *Service) Start() error
- func (service *Service) Stop() error
- func (service *Service) Update(conn *mongo.Conn, q *mongo.Query) (int32, error)
Constants ¶
View Source
const (
ObjectID = "_id"
)
Variables ¶
View Source
var ErrNotSupported = errors.New("not supported")
Functions ¶
func DecodeBSONDocument ¶
DecodeBSONDocument returns the decorded BSON object from the specified object.
Types ¶
type BSONDecoder ¶
type BSONDecoder struct { }
BSONDecoder represents a decoder.
func NewBSONDecoder ¶
func NewBSONDecoder() *BSONDecoder
NewBSONDecoder returns a new CBOR erializer instance.
func (*BSONDecoder) DecodeBSON ¶
DecodeBSON returns the decorded BSON object from the specified object.
type BSONEncoder ¶
type BSONEncoder struct { }
BSONEncoder represents a BSON encoder.
func NewBSONEncoder ¶
func NewBSONEncoder() *BSONEncoder
NewBSONEncoder returns a new BSON encoder instance.
func (*BSONEncoder) EncodeBSON ¶
EncodeBSON encodes the specified BSON object to a document object.
type Coder ¶ added in v0.9.0
type Coder struct { *BSONDecoder *BSONEncoder }
A Coder includes a BSON decoder and encoder.
type Service ¶
type Service struct { *mongo.Server *query.BaseService *Coder }
func (*Service) GetDatabase ¶
GetDatabase returns the database with the specified name.
func (*Service) MessageReceived ¶
MessageReceived passes a request message from MongoDB client.
func (*Service) MessageRespond ¶
MessageRespond passes a response message from mongo.Server.
func (*Service) ServiceName ¶
ServiceName returns the plug-in service name.
Click to show internal directories.
Click to hide internal directories.