func getTotalPerChannel(date string, keyFragments string, channel int, redisScript *redis.Script, redisConn redis.Conn) int { key := "Organizer:" + ORGANIZER + ":Event:" + EVENT + ":Channel:" + strconv.Itoa(channel) + ":Session:" + SESSION + ":Date:" + date + ":" + keyFragments values, values_err := redis.Int(redisScript.Do(redisConn, key)) if values_err != nil { values = 0 } return values }
func getTicketTypeTotals(date string, keyType string, ticketId int, channelTypes map[int]string, redisScript *redis.Script, redisConn redis.Conn) int { result := 0 for channel, _ := range channelTypes { ticketTypeKey := "Organizer:" + ORGANIZER + ":Event:" + EVENT + ":Channel:" + strconv.Itoa(channel) + ":Session:" + SESSION + ":TicketType:" + strconv.Itoa(ticketId) + ":Date:" + date + ":" + keyType values, values_err := redis.Int(redisScript.Do(redisConn, ticketTypeKey)) if values_err != nil { values = 0 } result += values } return result }