mirror of
https://github.com/dstotijn/hetty
synced 2024-11-14 16:07:10 +00:00
e59b9d6663
* Create mutation to clear request logs * Add UI for clearing all HTTP request logs * Use consistent naming * Explicitly delete only from http_requests * Check if datebase is open * Add confirmation dialog
23 lines
804 B
Go
23 lines
804 B
Go
package reqlog
|
|
|
|
import (
|
|
"context"
|
|
"net/http"
|
|
"time"
|
|
|
|
"github.com/dstotijn/hetty/pkg/scope"
|
|
)
|
|
|
|
type RepositoryProvider interface {
|
|
Repository() Repository
|
|
}
|
|
|
|
type Repository interface {
|
|
FindRequestLogs(ctx context.Context, filter FindRequestsFilter, scope *scope.Scope) ([]Request, error)
|
|
FindRequestLogByID(ctx context.Context, id int64) (Request, error)
|
|
AddRequestLog(ctx context.Context, req http.Request, body []byte, timestamp time.Time) (*Request, error)
|
|
AddResponseLog(ctx context.Context, reqID int64, res http.Response, body []byte, timestamp time.Time) (*Response, error)
|
|
ClearRequestLogs(ctx context.Context) error
|
|
UpsertSettings(ctx context.Context, module string, settings interface{}) error
|
|
FindSettingsByModule(ctx context.Context, module string, settings interface{}) error
|
|
}
|