Skip to content
Snippets Groups Projects
unmarshalJSON.go 462 B
package query

import (
	"encoding/json"

	"git.science.uu.nl/graphpolaris/query-conversion/entity"
)

/*
UnmarshalJSON takes an incoming message and unmarshals it
	msg: *[]byte, the incoming message
	Returns: *entity.IncomingQueryJSON, the unmarshalled message and a possible error
*/
func UnmarshalJSON(msg *[]byte) (*entity.IncomingQueryJSON, error) {
	var JSONQuery entity.IncomingQueryJSON
	err := json.Unmarshal(*msg, &JSONQuery)
	return &JSONQuery, err
}