Documentation ¶
Index ¶
- func GetClient() *mongo.Client
- type AbstractRepository
- func (r *AbstractRepository) DeleteById(id string) chan error
- func (r *AbstractRepository) DeleteOne(filters bson.M) chan error
- func (r *AbstractRepository) Find(filters bson.M, sort bson.D, limit, skip int64) chan Result
- func (r *AbstractRepository) FindOne(filters bson.M) chan Result
- func (r *AbstractRepository) FindOneById(id string) chan Result
- func (r *AbstractRepository) GetModel(proto interface{}) interface{}
- func (r *AbstractRepository) IsExistsById(id string) bool
- func (r *AbstractRepository) Save(model DbModel) chan error
- type DbModel
- type Result
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AbstractRepository ¶
func (*AbstractRepository) DeleteById ¶ added in v0.1.9
func (r *AbstractRepository) DeleteById(id string) chan error
func (*AbstractRepository) DeleteOne ¶ added in v0.1.9
func (r *AbstractRepository) DeleteOne(filters bson.M) chan error
func (*AbstractRepository) FindOne ¶
func (r *AbstractRepository) FindOne(filters bson.M) chan Result
Finds one object based on filters.
func (*AbstractRepository) FindOneById ¶
func (r *AbstractRepository) FindOneById(id string) chan Result
Finds one object based on Id.
func (*AbstractRepository) GetModel ¶
func (r *AbstractRepository) GetModel(proto interface{}) interface{}
Gets an instance of model from proto or othe object.
func (*AbstractRepository) IsExistsById ¶ added in v0.1.7
func (r *AbstractRepository) 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 (*AbstractRepository) Save ¶
func (r *AbstractRepository) Save(model DbModel) chan error
Click to show internal directories.
Click to hide internal directories.