synctest
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
package jsonextractor
|
||||
|
||||
import (
|
||||
"context"
|
||||
)
|
||||
|
||||
type Result struct {
|
||||
value string
|
||||
}
|
||||
|
||||
func NewResult(value string) *Result {
|
||||
return &Result{value}
|
||||
}
|
||||
|
||||
func (r *Result) GetValue(ctx context.Context) (string, error) {
|
||||
return r.value, nil
|
||||
}
|
||||
@@ -4,10 +4,10 @@ import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"gotemplate/internal/database"
|
||||
"gotemplate/internal/database/repository"
|
||||
"gotemplate/internal/query"
|
||||
"gotemplate/internal/result"
|
||||
"queryorchestration/internal/database"
|
||||
"queryorchestration/internal/database/repository"
|
||||
"queryorchestration/internal/query"
|
||||
"queryorchestration/internal/result"
|
||||
|
||||
"github.com/tidwall/gjson"
|
||||
)
|
||||
@@ -29,7 +29,10 @@ func (e *Extractor) Process(ctx context.Context, query query.Query, values *[]re
|
||||
return "", fmt.Errorf("JSON Extraction requires 1 result")
|
||||
}
|
||||
|
||||
value := (*values)[0].Value
|
||||
value, err := (*values)[0].GetValue(ctx)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
byteConfig, err := e.db.GetQueryConfig(ctx, repository.GetQueryConfigParams{
|
||||
Queryid: database.MustToDBUUID(query.ID),
|
||||
|
||||
Reference in New Issue
Block a user