gosexy / redis

Redis client for Go that maps the full redis command list into equivalent Go functions.
MIT License
167 stars 44 forks source link

Info command output should be parsed into a struct - enhancement request #30

Open therealbill opened 10 years ago

therealbill commented 10 years ago

Currently to make use of the INFO command you have to parse the resulting string. Bindings for redis clients in other languages tend to use the info command as an opportunity to return, for example, a map of the results. This makes using the info command simple, and improves the usability of the library.

It would be better if the info command did the same. Since Go (afaik) doesn't allow maps with different value types a struct could be returned. This would provide the caller with directly usable info results lowering the curve for using this library.

The downside would likely be the need to update the struct construction when new fields and sections are added. However, once the base code for doing the conversion is done (I'm still new to go) I'd be happy to do that maintenance when those changes occur.