Documentation
¶
Index ¶
- Variables
- type Identifiable
- type Repository
- func (repo *Repository) DeleteBy(field string, operator constants.ComparisonOperator, value interface{}) error
- func (repo *Repository) DeleteById(id string) error
- func (repo *Repository) Find(order constants.SortOrder, size, offset int) (int, []interface{}, error)
- func (repo *Repository) FindAll() ([]interface{}, error)
- func (repo *Repository) FindByIds(ids ...string) ([]interface{}, error)
- func (repo *Repository) FindOneBy(criteria map[string]interface{}) (interface{}, error)
- func (repo *Repository) FindOneById(id string) (interface{}, error)
- func (repo *Repository) GetNumberOfRows() (int, error)
- func (repo *Repository) Insert(entity interface{}) (interface{}, error)
- func (repo *Repository) Latest() (interface{}, error)
- func (repo *Repository) MapFromEntity(model *database.Model) (interface{}, error)
- func (repo *Repository) MapToEntity(entity interface{}) *database.Model
- func (repo *Repository) ScanRow(row Row) (interface{}, error)
- func (repo *Repository) TableName() string
- func (repo *Repository) UpdateById(id string, update interface{}) (interface{}, error)
- type Row
- type RowScanner
- type Temporal
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultQuerySize = 100
Functions ¶
This section is empty.
Types ¶
type Identifiable ¶
type Repository ¶
type Repository struct {
// contains filtered or unexported fields
}
func New ¶
func New(pool *pgxpool.Pool, model database.ModelInterface) (*Repository, error)
func (*Repository) DeleteBy ¶
func (repo *Repository) DeleteBy(field string, operator constants.ComparisonOperator, value interface{}) error
func (*Repository) DeleteById ¶
func (repo *Repository) DeleteById(id string) error
func (*Repository) FindAll ¶
func (repo *Repository) FindAll() ([]interface{}, error)
func (*Repository) FindByIds ¶
func (repo *Repository) FindByIds(ids ...string) ([]interface{}, error)
func (*Repository) FindOneBy ¶
func (repo *Repository) FindOneBy(criteria map[string]interface{}) (interface{}, error)
func (*Repository) FindOneById ¶
func (repo *Repository) FindOneById(id string) (interface{}, error)
func (*Repository) GetNumberOfRows ¶
func (repo *Repository) GetNumberOfRows() (int, error)
func (*Repository) Insert ¶
func (repo *Repository) Insert(entity interface{}) (interface{}, error)
func (*Repository) Latest ¶
func (repo *Repository) Latest() (interface{}, error)
func (*Repository) MapFromEntity ¶
func (repo *Repository) MapFromEntity(model *database.Model) (interface{}, error)
func (*Repository) MapToEntity ¶
func (repo *Repository) MapToEntity(entity interface{}) *database.Model
MapToEntity maps a domain model to a Database Model
func (*Repository) ScanRow ¶
func (repo *Repository) ScanRow(row Row) (interface{}, error)
func (*Repository) TableName ¶
func (repo *Repository) TableName() string
func (*Repository) UpdateById ¶
func (repo *Repository) UpdateById(id string, update interface{}) (interface{}, error)
type RowScanner ¶
Click to show internal directories.
Click to hide internal directories.