Documentation ¶
Index ¶
- type MongoRecordRepository
- func (repo *MongoRecordRepository) CountRecords(ctx context.Context, entity *pubdomain.Entity) (uint64, error)
- func (repo *MongoRecordRepository) CreateRecord(ctx context.Context, entity *pubdomain.Entity, record *pubdomain.Record) (*pubdomain.Record, error)
- func (repo *MongoRecordRepository) DeleteRecord(ctx context.Context, entity *pubdomain.Entity, recordId string) error
- func (repo *MongoRecordRepository) GetRecord(ctx context.Context, entity *pubdomain.Entity, recordId string) (*pubdomain.Record, error)
- func (repo *MongoRecordRepository) ListRecords(ctx context.Context, entity *pubdomain.Entity, pager *pubdomain.Pager) ([]*pubdomain.Record, error)
- func (repo *MongoRecordRepository) UpdateRecord(ctx context.Context, entity *pubdomain.Entity, recordId string, ...) (*pubdomain.Record, error)
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 *pubdomain.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 *pubdomain.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 *pubdomain.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 *pubdomain.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 *pubdomain.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 *pubdomain.Entity, recordId string, partialRecord *pubdomain.Record, ) (*pubdomain.Record, error)
UpdateRecord updates a record in the data store related to an entity
Click to show internal directories.
Click to hide internal directories.