I'm using redigo and ScanStruct is very useful. However it's obvious I'm trying to input urlhost and urlreq and these values are dynamically generated based on the actual uri of the user.
Obviously the code below doesn't work so how do I achieve what I want by being able to dynamically naming my struct so I can ScanStruct properly?
func GetInfo(urlhost string, urlreq string) {
type qwInfo struct {
"s"+urlreq int
"c"+urlreq []byte
"t"+urlreq int
}
var QwInfo qwInfo
c := pool.Get()
defer c.Close()
values, _ := redis.Values(c.Do("HMGET", urlhost, "s"+urlreq, "c"+urlreq, "t"+urlreq))
redis.ScanStruct(values, &QwInfo);
Thanks in advance.