27 lines
530 B
Go
27 lines
530 B
Go
package main
|
|
|
|
import (
|
|
"context"
|
|
"time"
|
|
"watch-tool/models"
|
|
)
|
|
|
|
type StorageInterface interface {
|
|
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
|
|
}
|
|
|
|
type StorageQuery struct {
|
|
StartTime time.Time
|
|
EndTime time.Time
|
|
Service string
|
|
Tool string
|
|
LogLevel string
|
|
Type string
|
|
Limit int
|
|
Offset int
|
|
OrderBy string
|
|
OrderDesc bool
|
|
}
|