mongorpc

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 5, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package mongorpc provides the gRPC service implementations.

Package mongorpc provides the gRPC service implementations.

Package mongorpc provides the gRPC service implementations.

Package mongorpc provides streaming RPC implementations.

Package mongorpc provides transaction RPC implementations.

Package mongorpc provides additional RPC method implementations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

type Server struct {
	mongorpcv1.UnimplementedMongoRPCServer
	// contains filtered or unexported fields
}

Server implements the MongoRPC gRPC service.

func NewServer

func NewServer(db *mongodb.Client, rules *rules.Engine, adminKey, adminSecret string) *Server

NewServer creates a new MongoRPC server.

func (*Server) AbortTransaction

AbortTransaction aborts an active transaction.

func (*Server) Aggregate

Aggregate runs an aggregation pipeline with streaming results.

func (*Server) BatchGetDocuments

BatchGetDocuments gets multiple documents by ID with streaming.

func (*Server) BeginTransaction

BeginTransaction starts a new transaction.

func (*Server) CommitTransaction

CommitTransaction commits an active transaction.

func (*Server) CountDocuments

CountDocuments counts documents matching a filter.

func (*Server) CreateCollection

func (s *Server) CreateCollection(ctx context.Context, req *mongorpcv1.CreateCollectionRequest) (*emptypb.Empty, error)

CreateCollection creates a new collection.

func (*Server) CreateDocument

CreateDocument creates a new document.

func (*Server) CreateIndex

CreateIndex creates an index on a collection.

func (*Server) DeleteDocument

DeleteDocument deletes a document by ID.

func (*Server) DeleteMany

DeleteMany deletes multiple documents.

func (*Server) DropCollection

func (s *Server) DropCollection(ctx context.Context, req *mongorpcv1.DropCollectionRequest) (*emptypb.Empty, error)

DropCollection drops a collection.

func (*Server) DropIndex

func (s *Server) DropIndex(ctx context.Context, req *mongorpcv1.DropIndexRequest) (*emptypb.Empty, error)

DropIndex removes an index from a collection.

func (*Server) GetDocument

GetDocument retrieves a single document by ID.

func (*Server) GetSession

func (s *Server) GetSession(txnID string) (*mongo.Session, bool)

GetSession returns the session for a transaction (for use in other RPC methods).

func (*Server) InsertMany

InsertMany inserts multiple documents.

func (*Server) ListCollections

ListCollections lists all collections in a database.

func (*Server) ListDocuments

ListDocuments lists documents in a collection.

func (*Server) ListIndexes

ListIndexes lists all indexes on a collection.

func (*Server) RenameCollection

func (s *Server) RenameCollection(ctx context.Context, req *mongorpcv1.RenameCollectionRequest) (*emptypb.Empty, error)

RenameCollection renames a collection.

func (*Server) RunQuery

RunQuery runs a query with streaming results.

func (*Server) UpdateDocument

UpdateDocument updates an existing document.

func (*Server) UpdateMany

UpdateMany updates multiple documents.

func (*Server) Watch

Watch watches a collection for changes (change streams).

type TransactionManager

type TransactionManager struct {
	// contains filtered or unexported fields
}

TransactionManager manages active transactions.

func NewTransactionManager

func NewTransactionManager() *TransactionManager

NewTransactionManager creates a new transaction manager.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL