Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Store ¶
type Store[T any] struct { // contains filtered or unexported fields }
Store represents MongoDB repository storage
func NewClient ¶
NewClient returns a new MongoDB storage url format mongodb://mongodb0.example.com:27017
func (*Store[T]) FetchDocs ¶
FetchDocs is a function which returns all documents present the MongoDB store used for testing purposes in `e2e_test.go`
func (*Store[T]) Upload ¶
Upload uploads all payloads to a MongoDB collection with a callback function attached This uses a MongoDB transaction https://www.mongodb.com/docs/manual/core/transactions/ for ACID transactions in tandem with the callback function provided This ensures either both MongoDB and the callback succeed or they both fail the callback in this case is `upload to GRPC server` as per the problem statement Note:- MongoDB transaction feature requires replica sets https://www.mongodb.com/docs/manual/replication/