packagedaoimport("goku-ce-1.0/dao/cache""github.com/farseer810/yawf""github.com/garyburd/redigo/redis""goku-ce-1.0/dao/database")funcloadGatewayHashKey(gatewayAliasstring)string{db:=database.GetConnection()vargatewayHashKeystringsql:=`SELECT hashKey FROM eo_gateway WHERE gatewayAlias = ?; `err:=db.QueryRow(sql,gatewayAlias).Scan(&gatewayHashKey)iferr!=nil{panic(err)}returngatewayHashKey}funcGetGatewayHashKey(contextyawf.Context,gatewayAliasstring)string{varredisKeystring="gatewayHashKey:"+gatewayAliasconn:=cache.GetConnection(context)gatewayHashKey,err:=redis.String(conn.Do("GET",redisKey))iferr==redis.ErrNil{gatewayHashKey=loadGatewayHashKey(gatewayAlias)conn.Do("SET",redisKey,gatewayHashKey)}elseiferr!=nil{panic(err)}returngatewayHashKey}