integrate boltdb engine.

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
This commit is contained in:
Bo-Yi Wu
2016-05-02 20:22:37 +08:00
parent 03ab8eeac7
commit 5994f48e7e
5 changed files with 136 additions and 119 deletions

View File

@@ -25,7 +25,7 @@ func New(config config.ConfYaml) *Storage {
}
}
func getRedisInt64Result(key string, count *int64) {
func getInt64(key string, count *int64) {
val, _ := RedisClient.Get(key).Result()
*count, _ = strconv.ParseInt(val, 10, 64)
}
@@ -88,35 +88,35 @@ func (s *Storage) AddAndroidError(count int64) {
func (s *Storage) GetTotalCount() int64 {
var count int64
getRedisInt64Result(TotalCountKey, &count)
getInt64(TotalCountKey, &count)
return count
}
func (s *Storage) GetIosSuccess() int64 {
var count int64
getRedisInt64Result(IosSuccessKey, &count)
getInt64(IosSuccessKey, &count)
return count
}
func (s *Storage) GetIosError() int64 {
var count int64
getRedisInt64Result(IosErrorKey, &count)
getInt64(IosErrorKey, &count)
return count
}
func (s *Storage) GetAndroidSuccess() int64 {
var count int64
getRedisInt64Result(AndroidSuccessKey, &count)
getInt64(AndroidSuccessKey, &count)
return count
}
func (s *Storage) GetAndroidError() int64 {
var count int64
getRedisInt64Result(AndroidErrorKey, &count)
getInt64(AndroidErrorKey, &count)
return count
}