nsq icon indicating copy to clipboard operation
nsq copied to clipboard

nsqd: use metadata struct for both marshal and unmarshal

Open karalabe opened this issue 4 years ago • 1 comments

Metadata marshaling currently is done via a map containing untyped interfaces, which is unfortunate given that the code also contains a meta type used during unmarshaling.

This commit elevates the old meta type a bit to be used during both operations. The changeste also exposes a GetMetadata method to return the same metadata type without pushing it to disk. This is useful for use cases where NSQD is embedded into another Go program and some introspection is needed.

karalabe avatar Oct 19 '21 13:10 karalabe

Hmm, I've seen that I can list all the topics by specifying "" for nsqd.GetStatus, so maybe this PR is not that useful at the end of the day. Still, might be a nice code cleanup to use a data struct on marshaling too vs. making a map of interfaces.

karalabe avatar Oct 20 '21 09:10 karalabe

updated this myself

mreiferson avatar Aug 02 '22 03:08 mreiferson