Documentation ¶
Index ¶
- Constants
- type EventRepository
- func (r EventRepository) Create(ctx context.Context, entity *event.Event) error
- func (r EventRepository) Delete(ctx context.Context, id uint) error
- func (r EventRepository) Get(ctx context.Context, id uint) (*event.Event, error)
- func (r EventRepository) ListForNotifications(ctx context.Context, offset, limit uint) ([]event.Event, error)
- func (r EventRepository) Query(ctx context.Context, query *event.QueryCondition, offset, limit uint) ([]event.Event, error)
- func (r EventRepository) SetHadNoticed(ctx context.Context, id uint) error
- func (r EventRepository) Update(ctx context.Context, entity *event.Event) error
- type IRepository
Constants ¶
View Source
const Limit = 100
Limit is default limit
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EventRepository ¶
type EventRepository struct {
// contains filtered or unexported fields
}
EventRepository is a repository for the event entity
func NewEventRepository ¶
func NewEventRepository(repository *repository) (*EventRepository, error)
NewEventRepository creates a new Repository
func (EventRepository) Delete ¶
func (r EventRepository) Delete(ctx context.Context, id uint) error
Delete deletes a record with the specified ID from the database.
func (EventRepository) ListForNotifications ¶
func (r EventRepository) ListForNotifications(ctx context.Context, offset, limit uint) ([]event.Event, error)
ListForNotifications returns list of events for notification
func (EventRepository) Query ¶
func (r EventRepository) Query(ctx context.Context, query *event.QueryCondition, offset, limit uint) ([]event.Event, error)
Query retrieves records with the specified offset and limit from the database.
func (EventRepository) SetHadNoticed ¶
func (r EventRepository) SetHadNoticed(ctx context.Context, id uint) error
SetHadNoticed set event had noticed
type IRepository ¶
type IRepository interface{}
IRepository is an interface of repository
func GetRepository ¶
func GetRepository(dbase db.IDB, logger log.ILogger, entity string) (repo IRepository, err error)
GetRepository return a repository
Click to show internal directories.
Click to hide internal directories.