Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Callback ¶
type Callback func(sessCtx mongo.SessionContext) (interface{}, error)
Callback describes callback accepted by session.WithTransaction
type MongoExecutor ¶
MongoExecutor manages mongo transaction
func NewMongoExecutor ¶
func NewMongoExecutor(client *mongo.Client) *MongoExecutor
NewMongoExecutor creates new MongoExecutor for transaction management
func (*MongoExecutor) WithTransaction ¶
func (e *MongoExecutor) WithTransaction(callback Callback) error
WithTransaction execute callback within transaction
Click to show internal directories.
Click to hide internal directories.