Documentation ¶
Index ¶
- Variables
- type DBConfig
- type DBConn
- type Repository
- func (r *Repository[Entity, ID]) Create(entity *Entity) error
- func (r *Repository[Entity, ID]) Delete(filter *Entity) (affected int, err error)
- func (r *Repository[Entity, ID]) DeleteByID(id ID) error
- func (r *Repository[Entity, ID]) FindOne(filter *Entity) (*Entity, error)
- func (r *Repository[Entity, ID]) FindOneByID(id ID) (*Entity, error)
- func (r *Repository[Entity, ID]) Update(filter *Entity, entity *Entity) (affected int, err error)
- func (r *Repository[Entity, ID]) UpdateByID(id ID, entity *Entity) error
- func (r *Repository[Entity, ID]) Upsert(id ID, entity *Entity) error
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrNotFound = errors.New("record not found")
)
Functions ¶
This section is empty.
Types ¶
type Repository ¶
func (*Repository[Entity, ID]) Create ¶
func (r *Repository[Entity, ID]) Create(entity *Entity) error
func (*Repository[Entity, ID]) Delete ¶
func (r *Repository[Entity, ID]) Delete(filter *Entity) (affected int, err error)
func (*Repository[Entity, ID]) DeleteByID ¶
func (r *Repository[Entity, ID]) DeleteByID(id ID) error
func (*Repository[Entity, ID]) FindOne ¶
func (r *Repository[Entity, ID]) FindOne(filter *Entity) (*Entity, error)
func (*Repository[Entity, ID]) FindOneByID ¶
func (r *Repository[Entity, ID]) FindOneByID(id ID) (*Entity, error)
func (*Repository[Entity, ID]) Update ¶
func (r *Repository[Entity, ID]) Update(filter *Entity, entity *Entity) (affected int, err error)
func (*Repository[Entity, ID]) UpdateByID ¶
func (r *Repository[Entity, ID]) UpdateByID(id ID, entity *Entity) error
func (*Repository[Entity, ID]) Upsert ¶
func (r *Repository[Entity, ID]) Upsert(id ID, entity *Entity) error
Click to show internal directories.
Click to hide internal directories.