mongo

package
v0.0.0-...-2c15619 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetSessionContext

func GetSessionContext(ctx context.Context) mongo.SessionContext

func NewMongoDb

func NewMongoDb(config Config) (*mongo.Database, *mongo.Client)

Types

type Config

type Config struct {
	MongoDb  string
	Database string
}

type IEntity

type IEntity struct {
	Id primitive.ObjectID `json:"id" bson:"_id"`
}

type TransactionMiddleware

type TransactionMiddleware[T ddd.IBaseUseCase, R any] struct {
	// contains filtered or unexported fields
}

func NewTransactionMiddleware

func NewTransactionMiddleware[T ddd.IBaseUseCase, R any](client *mongo.Client) *TransactionMiddleware[T, R]

func (*TransactionMiddleware[T, R]) After

func (s *TransactionMiddleware[T, R]) After(ctx context.Context, useCase T, err error, result *ddd.UseCaseResult[R]) (error, context.Context, T, *ddd.UseCaseResult[R])

func (*TransactionMiddleware[T, R]) Before

func (s *TransactionMiddleware[T, R]) Before(ctx context.Context, useCase T) (error, context.Context, T)

Jump to

Keyboard shortcuts

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