Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not decoding dynamic nested structs #13

Closed
sp98 opened this issue Aug 18, 2018 · 1 comment
Closed

Not decoding dynamic nested structs #13

sp98 opened this issue Aug 18, 2018 · 1 comment

Comments

@sp98
Copy link

sp98 commented Aug 18, 2018

I've to store a struct type in the queue. I don't have much control on this struct type and it can be a nested json data that I get from a request. For example

{
"name": "string",
  "quota": {
    "compute": {},
    "storage": {}
  },
  "regime": "string",
  "request_id": "test",
  "requestor_id": "string",
  "service_group": "string",
  "service_resource_id": "string",
  "tags": [
    "string"
  ],
  "update_uri": "string"
}

So if I try to add this struct (of type map[string]interface{}) as a prefix queue using pq.EnqueueObject([]byte(k), v)
Then its not getting added to the queue.

I think gob module is not able to decode it.

Is there any way to be able to store this data ?

@beeker1121
Copy link
Owner

Added methods to encode/decode objects using the encoding/json package vs encoding/gob ef8bb7f

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants