refactor: move models to their own package to use the same as in the importer
This commit is contained in:
parent
553a85562b
commit
9aa1b7384d
14 changed files with 170 additions and 152 deletions
|
|
@ -3,12 +3,13 @@ package main
|
|||
import (
|
||||
"context"
|
||||
"time"
|
||||
"tixel_watch/models"
|
||||
)
|
||||
|
||||
type StorageInterface interface {
|
||||
Store(ctx context.Context, entry *LogEntry) error
|
||||
StoreBatch(ctx context.Context, entries []LogEntry) error
|
||||
Query(ctx context.Context, query StorageQuery) ([]LogEntry, error)
|
||||
Store(ctx context.Context, entry *models.LogMessage) error
|
||||
StoreBatch(ctx context.Context, entries []models.LogMessage) error
|
||||
Query(ctx context.Context, query StorageQuery) ([]models.LogMessage, error)
|
||||
Close() error
|
||||
}
|
||||
|
||||
|
|
@ -26,6 +27,6 @@ type StorageQuery struct {
|
|||
}
|
||||
|
||||
type ExporterInterface interface {
|
||||
Export(ctx context.Context, entries []LogEntry) error
|
||||
Export(ctx context.Context, entries []models.LogMessage) error
|
||||
HealthCheck(ctx context.Context) error
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue