35 lines
494 B
Go
35 lines
494 B
Go
package query
|
|
|
|
import (
|
|
"gotemplate/internal/database/repository"
|
|
|
|
"github.com/google/uuid"
|
|
)
|
|
|
|
type QueryType int
|
|
|
|
const (
|
|
QueryTypeJsonExtractor = iota
|
|
)
|
|
|
|
type Query struct {
|
|
ID uuid.UUID
|
|
Type QueryType
|
|
RequiredQueryID uuid.UUID
|
|
Version int32
|
|
}
|
|
|
|
type Result struct {
|
|
ID uuid.UUID
|
|
QueryID uuid.UUID
|
|
QueryVersion int32
|
|
}
|
|
|
|
type Service struct {
|
|
db *repository.Queries
|
|
}
|
|
|
|
func New(db *repository.Queries) *Service {
|
|
return &Service{db}
|
|
}
|