mongo

package
v1.12.0 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2023 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MongoRecordRepository added in v1.3.0

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

RecordRepository defines the repository that stores, modifies and deletes record in Mongo

func NewMongoRecordRepository added in v1.3.0

func NewMongoRecordRepository(
	dbClient database.DatabaseClient,
) (*MongoRecordRepository, error)

NewMongoRecordRepository creates an instace of MongoRecordRepository

func (*MongoRecordRepository) CountRecords added in v1.10.0

func (repo *MongoRecordRepository) CountRecords(
	ctx context.Context,
	entity *domain.Entity,
) (uint64, error)

CountRecords returns the count of the records in the data store related to an entity

func (*MongoRecordRepository) CreateRecord added in v1.3.0

func (repo *MongoRecordRepository) CreateRecord(
	ctx context.Context,
	entity *domain.Entity,
	record *pubdomain.Record,
) (*pubdomain.Record, error)

CreateRecord creates a new record in the data store related to an entity

func (*MongoRecordRepository) DeleteRecord added in v1.7.0

func (repo *MongoRecordRepository) DeleteRecord(
	ctx context.Context,
	entity *domain.Entity,
	recordId string,
) error

DeleteRecord deletes a record in the data store related to an entity

func (*MongoRecordRepository) GetRecord added in v1.5.0

func (repo *MongoRecordRepository) GetRecord(
	ctx context.Context,
	entity *domain.Entity,
	recordId string,
) (*pubdomain.Record, error)

GetRecord gets a record from the data store related to an entity

func (*MongoRecordRepository) ListRecords added in v1.9.0

func (repo *MongoRecordRepository) ListRecords(
	ctx context.Context,
	entity *domain.Entity,
	pager *pubdomain.Pager,
) ([]*pubdomain.Record, error)

ListRecords gets a record list from the data store related to an entity

func (*MongoRecordRepository) UpdateRecord added in v1.6.0

func (repo *MongoRecordRepository) UpdateRecord(
	ctx context.Context,
	entity *domain.Entity,
	recordId string,
	partialRecord *pubdomain.Record,
) (*pubdomain.Record, error)

UpdateRecord updates a record in the data store related to an entity

Jump to

Keyboard shortcuts

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