Add mapstring output and update the README.

This commit is contained in:
2023-04-08 01:36:56 +01:00
parent 689b1efc43
commit d764980390
3 changed files with 10 additions and 2 deletions
+8
View File
@@ -120,6 +120,14 @@ func (c *BaseClient) Query(queryContent string, queryVariables interface{}, quer
func (c *BaseClient) decodeResponse(jsonData []byte) any {
switch c.responseType {
case "mapstring":
var response map[string]interface{}
err := json.Unmarshal(jsonData, &response)
if err != nil {
c.Logger.Error(c, "Error while converting to map[string]interface{};", "error", err.Error())
return nil
}
return response
case "string":
return helpers.BytesToString(jsonData)
case "byte":