Documentation
¶
Overview ¶
Package repository reads the audit log.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EventRepository ¶
type EventRepository struct {
// contains filtered or unexported fields
}
EventRepository reads audit events. There is deliberately no way to change or remove one here: the writes come from the audit plugin, and the log is append-only.
func NewEventRepository ¶
func NewEventRepository(db *gorm.DB) *EventRepository
NewEventRepository returns a repository backed by db.
func (*EventRepository) EntityTypes ¶
func (r *EventRepository) EntityTypes(ctx context.Context) ([]string, error)
EntityTypes returns every entity type that has an event, alphabetically.
func (*EventRepository) Find ¶
func (r *EventRepository) Find(ctx context.Context, q *dto.EventQuery) ([]model.Event, error)
Find returns up to q.Limit+1 events matching q, newest first. The extra row, if present, tells the caller there is another page without a second count query.