code: func CreateGatewayCache(p *redis.Pool, gw Gateway) error {
  	var buf bytes.Buffer
  	if err := gob.NewEncoder(&buf).Encode(gw); err != nil {
  		return errors.Wrap(err, "gob encode gateway error")
  	}
  
  	c := p.Get()
  	defer c.Close()
  
  	key := fmt.Sprintf(gatewayKeyTempl, gw.GatewayID)
  	exp := int64(deviceSessionTTL) / int64(time.Millisecond)
  
  	_, err := c.Do("PSETEX", key, exp, buf.Bytes())
  	if err != nil {
  		return errors.Wrap(err, "set gateway error")
  	}
  
  	return nil
  }
docs: // CreateGatewayCache caches the given gateway in Redis.
  // The TTL of the gateway is the same as that of the device-sessions.