#JSON unmarshal to string
13 messages · Page 1 of 1 (latest)
RawMessage ?
Thanks @stoic bay , the struct is:
type Config struct {
Type string `json:"type"`
Payload map[string]interface{} `json:"payload"`
}
So how would this be modified to incorporate it?
An example json is:
{"type": "reload", "payload": { "shared_buffers": 2.0 }}
may be you can describe each type?
instead of map[string]interface{} use actual type
then you can add proper types and json should parse them accordingly
The payload is arbitrary that is the main issue
Or you mean something else @worldly inlet
i would create a struct for each of the possible payloads
it cant be infinite
(i hope)
then you may check this
The payload is effectively any Postgresql setting, so yes it will be hard to write a custom one 😅