mirror of
https://github.com/netbirdio/netbird.git
synced 2026-09-29 10:09:07 +02:00
* extract shared db conn + data repository * extract repository interface * protect against nested transactions * fix mysql and db conn creation * fix context management * remove query warpper * remove withContext and withLock wrapper * remove context from function call * remove in memory mode * fix nested transaction handling * use db directly * remove leftover test * remove pool close on error during conn creation
19 lines
638 B
Go
19 lines
638 B
Go
package accesslogs
|
|
|
|
import (
|
|
"context"
|
|
"time"
|
|
|
|
"github.com/netbirdio/netbird/management/internals/shared/db"
|
|
)
|
|
|
|
//go:generate go tool mockgen -package accesslogs -destination=repository_mock.go -source=./repository.go -build_flags=-mod=mod
|
|
|
|
// Repository persists reverse proxy access log entries.
|
|
type Repository interface {
|
|
WithTx(tx *db.Tx) Repository
|
|
Create(ctx context.Context, entry *AccessLogEntry) error
|
|
ListByAccount(ctx context.Context, lockStrength db.LockingStrength, accountID string, filter AccessLogFilter) ([]*AccessLogEntry, int64, error)
|
|
DeleteOlderThan(ctx context.Context, olderThan time.Time) (int64, error)
|
|
}
|