Documentation ¶
Index ¶
- type Repository
- func (r *Repository) Aggregate(collectionName string, pipeline interface{}, results interface{}) error
- func (r *Repository) Count(collectionName string, filter interface{}) (int64, error)
- func (r *Repository) Create(collectionName string, _ string, entity interface{}) error
- func (r *Repository) Delete(collectionName string, filter interface{}) error
- func (r *Repository) DeleteByID(collectionName string, id string) error
- func (r *Repository) Disconnect()
- func (r *Repository) Find(collectionName string, filter interface{}, pageSize int, pageNumber int, ...) error
- func (r *Repository) FindByID(collectionName string, id string, entity interface{}) error
- func (r *Repository) GetName() string
- func (r *Repository) NewBucket() (*gridfs.Bucket, error)
- func (r *Repository) UpdateByID(collectionName string, id string, entity interface{}) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Repository ¶
type Repository struct {
// contains filtered or unexported fields
}
func NewMongoDBRepository ¶
func NewMongoDBRepository(timeout time.Duration, databaseName string, opts ...*options.ClientOptions) (*Repository, error)
func (*Repository) Aggregate ¶
func (r *Repository) Aggregate(collectionName string, pipeline interface{}, results interface{}) error
func (*Repository) Count ¶
func (r *Repository) Count(collectionName string, filter interface{}) (int64, error)
func (*Repository) Create ¶
func (r *Repository) Create(collectionName string, _ string, entity interface{}) error
func (*Repository) Delete ¶
func (r *Repository) Delete(collectionName string, filter interface{}) error
func (*Repository) DeleteByID ¶ added in v0.5.0
func (r *Repository) DeleteByID(collectionName string, id string) error
func (*Repository) Disconnect ¶
func (r *Repository) Disconnect()
func (*Repository) FindByID ¶
func (r *Repository) FindByID(collectionName string, id string, entity interface{}) error
func (*Repository) GetName ¶
func (r *Repository) GetName() string
func (*Repository) UpdateByID ¶ added in v0.5.0
func (r *Repository) UpdateByID(collectionName string, id string, entity interface{}) error
Click to show internal directories.
Click to hide internal directories.