36 lines
574 B
Go
36 lines
574 B
Go
package query
|
|
|
|
import (
|
|
"context"
|
|
"queryorchestration/internal/database/repository"
|
|
"queryorchestration/internal/result"
|
|
|
|
"github.com/google/uuid"
|
|
)
|
|
|
|
type Type int
|
|
|
|
const (
|
|
TypeJsonExtractor = iota
|
|
TypeContextFull
|
|
)
|
|
|
|
type Query struct {
|
|
ID uuid.UUID
|
|
Type Type
|
|
RequiredQueryID uuid.UUID
|
|
Version int32
|
|
}
|
|
|
|
type Processor interface {
|
|
Process(ctx context.Context, query Query, values *[]result.Value) (string, error)
|
|
}
|
|
|
|
type Service struct {
|
|
db *repository.Queries
|
|
}
|
|
|
|
func New(db *repository.Queries) *Service {
|
|
return &Service{db}
|
|
}
|