0ddae4f91e
remove query from codebase part 1 * remove query * fix localstack run
43 lines
740 B
Go
43 lines
740 B
Go
package queryapi
|
|
|
|
import (
|
|
"errors"
|
|
|
|
"queryorchestration/internal/client"
|
|
|
|
"github.com/google/uuid"
|
|
)
|
|
|
|
// Query parsing functions have been removed.
|
|
// See remove_query_plan.md for details.
|
|
|
|
func parseStringToUUIDArray(sids *[]string) (*[]uuid.UUID, error) {
|
|
var ids []uuid.UUID
|
|
if sids != nil {
|
|
ids = make([]uuid.UUID, len(*sids))
|
|
for index, id := range *sids {
|
|
parsedID, err := uuid.Parse(id)
|
|
if err != nil {
|
|
return nil, errors.New("invalid required id")
|
|
}
|
|
|
|
ids[index] = parsedID
|
|
}
|
|
|
|
return &ids, nil
|
|
}
|
|
|
|
return nil, nil
|
|
}
|
|
|
|
func parseClientStatus(status client.Status) ClientStatus {
|
|
switch status {
|
|
case client.IN_SYNC:
|
|
return INSYNC
|
|
case client.NOT_SYNCING:
|
|
return NOTSYNCING
|
|
}
|
|
|
|
return NOTSYNCED
|
|
}
|