Documentation ¶
Index ¶
- type MongodbMutexes
- type MongodbRepository
- type MongodbStore
- func (store *MongodbStore[T]) Load(ctx context.Context, id any) (entity T, found bool, err error)
- func (store *MongodbStore[T]) RemoveAll(ctx context.Context, ids []any) error
- func (store *MongodbStore[T]) Save(ctx context.Context, id any, entity T) error
- func (store *MongodbStore[T]) SaveAll(ctx context.Context, entitiesToInsert map[any]any, ...) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MongodbMutexes ¶
type MongodbMutexes struct {
// contains filtered or unexported fields
}
func NewMongodbMutexes ¶
func NewMongodbMutexes(client *mongo.Client, database string, collection string) *MongodbMutexes
func (*MongodbMutexes) NewAndLock ¶
type MongodbRepository ¶
type MongodbRepository[T any] struct { arp.Repository[T] // contains filtered or unexported fields }
func NewMongodbRepository ¶
func NewMongodbRepository[T any](client *mongo.Client, database string, collection string, newZeroEntity arp.NewZeroEntity[T]) *MongodbRepository[T]
func NewMongodbRepositoryWithMutexesimpl ¶
func NewMongodbRepositoryWithMutexesimpl[T any](client *mongo.Client, database string, collection string, newZeroEntity arp.NewZeroEntity[T], mutexesimpl arp.Mutexes) *MongodbRepository[T]
func (*MongodbRepository[T]) Count ¶
func (repo *MongodbRepository[T]) Count(ctx context.Context) (uint64, error)
func (*MongodbRepository[T]) QueryAllByField ¶
func (*MongodbRepository[T]) QueryAllIds ¶
func (repo *MongodbRepository[T]) QueryAllIds(ctx context.Context) (ids []any, err error)
type MongodbStore ¶
type MongodbStore[T any] struct { // contains filtered or unexported fields }
func NewMongodbStore ¶
func NewMongodbStore[T any](coll *mongo.Collection, newZeroEntity arp.NewZeroEntity[T]) *MongodbStore[T]
func (*MongodbStore[T]) RemoveAll ¶
func (store *MongodbStore[T]) RemoveAll(ctx context.Context, ids []any) error
Click to show internal directories.
Click to hide internal directories.