Documentation ¶
Index ¶
- func GetClient() *mongo.Client
- type BootRepository
- type DbModel
- type UnimplementedBootRepository
- func (r *UnimplementedBootRepository[T]) Aggregate(pipeline bson.A) (chan []T, chan error)
- func (r *UnimplementedBootRepository[T]) CountDocuments(filters bson.M) (chan int64, chan error)
- func (r *UnimplementedBootRepository[T]) DeleteById(id string) chan error
- func (r *UnimplementedBootRepository[T]) DeleteOne(filters bson.M) chan error
- func (r *UnimplementedBootRepository[T]) Distinct(fieldName string, filters bson.D, serverMaxTime time.Duration) (chan []interface{}, chan error)
- func (r *UnimplementedBootRepository[T]) Find(filters bson.M, sort bson.D, limit, skip int64) (chan []T, chan error)
- func (r *UnimplementedBootRepository[T]) FindOne(filters bson.M) (chan *T, chan error)
- func (r *UnimplementedBootRepository[T]) FindOneById(id string) (chan *T, chan error)
- func (r *UnimplementedBootRepository[T]) GetModel(proto interface{}) *T
- func (r *UnimplementedBootRepository[T]) IsExistsById(id string) bool
- func (r *UnimplementedBootRepository[T]) Save(model DbModel) chan error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BootRepository ¶ added in v0.1.35
type BootRepository[T any] interface { Save(model DbModel) chan error FindOneById(id string) (chan *T, chan error) IsExistsById(id string) bool CountDocuments(filters bson.M) (chan int64, chan error) Distinct(fieldName string, filters bson.D, serverMaxTime time.Duration) (chan []interface{}, chan error) FindOne(filters bson.M) (chan *T, chan error) Find(filters bson.M, sort bson.D, limit, skip int64) (chan []T, chan error) DeleteById(id string) chan error DeleteOne(filters bson.M) chan error GetModel(proto interface{}) *T Aggregate(pipeline bson.A) (chan []T, chan error) }
type UnimplementedBootRepository ¶ added in v0.1.35
func (*UnimplementedBootRepository[T]) Aggregate ¶ added in v0.1.35
func (r *UnimplementedBootRepository[T]) Aggregate(pipeline bson.A) (chan []T, chan error)
func (*UnimplementedBootRepository[T]) CountDocuments ¶ added in v0.1.35
func (r *UnimplementedBootRepository[T]) CountDocuments(filters bson.M) (chan int64, chan error)
Finds documents count on filters.
func (*UnimplementedBootRepository[T]) DeleteById ¶ added in v0.1.35
func (r *UnimplementedBootRepository[T]) DeleteById(id string) chan error
func (*UnimplementedBootRepository[T]) DeleteOne ¶ added in v0.1.35
func (r *UnimplementedBootRepository[T]) DeleteOne(filters bson.M) chan error
func (*UnimplementedBootRepository[T]) Distinct ¶ added in v0.1.35
func (r *UnimplementedBootRepository[T]) Distinct(fieldName string, filters bson.D, serverMaxTime time.Duration) (chan []interface{}, chan error)
Finds all unique values for a field
func (*UnimplementedBootRepository[T]) FindOne ¶ added in v0.1.35
func (r *UnimplementedBootRepository[T]) FindOne(filters bson.M) (chan *T, chan error)
Finds one object based on filters.
func (*UnimplementedBootRepository[T]) FindOneById ¶ added in v0.1.35
func (r *UnimplementedBootRepository[T]) FindOneById(id string) (chan *T, chan error)
Finds one object based on Id.
func (*UnimplementedBootRepository[T]) GetModel ¶ added in v0.1.35
func (r *UnimplementedBootRepository[T]) GetModel(proto interface{}) *T
Gets an instance of model from proto or othe object.
func (*UnimplementedBootRepository[T]) IsExistsById ¶ added in v0.1.35
func (r *UnimplementedBootRepository[T]) IsExistsById(id string) bool
checks if a record exists by id. Synchronous becuase it is expected to be very light-weighted without deserialization etc.
func (*UnimplementedBootRepository[T]) Save ¶ added in v0.1.35
func (r *UnimplementedBootRepository[T]) Save(model DbModel) chan error
Click to show internal directories.
Click to hide internal directories.