store

package
v0.0.0-...-e477a49 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 17, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Prefix       = "keyboard:"
	DateFormat   = "2006:01:02"
	TimeFormat   = ctk.HH_MM_SS
	MsTimeFormat = ctk.HH_MM_SS_MS
)
View Source
const (
	LastInputEvent = Prefix + "last-event" // last use event. STRING
	TotalCount     = Prefix + "total"      // total count. ZSET
	KeyMap         = Prefix + "key-map"    // all key code map. HASH
)

Variables

This section is empty.

Functions

func AddKeyDetail

func AddKeyDetail(time time.Time, keyNs int64, keyCode uint16)

func CloseConnection

func CloseConnection()

func CloseRedisConnectionThenExit

func CloseRedisConnectionThenExit()

func ExportDetailToCsv

func ExportDetailToCsv(day time.Time)

func GetConnection

func GetConnection() *redis.Client

func GetDb

func GetDb() *leveldb.DB

func GetDetailKey

func GetDetailKey(time time.Time) string

GetDetailKey by time zset member 时间戳 score keyCode

func GetDetailKeyByString

func GetDetailKeyByString(timeStr string) string

func GetRankKey

func GetRankKey(time time.Time) string

GetRankKey by time zset member keyCode score 按键数

func GetRankKeyByString

func GetRankKeyByString(timeStr string) string

GetRankKeyByString

func GetTodayMaxKPMKey

func GetTodayMaxKPMKey(time time.Time) string

string max kpm in today

func GetTodayMaxKPMKeyByString

func GetTodayMaxKPMKeyByString(timeStr string) string

func GetTodayTempKPMKey

func GetTodayTempKPMKey(time time.Time) string

func GetTodayTempKPMKeyByString

func GetTodayTempKPMKeyByString(timeStr string) string

func IncrRankKey

func IncrRankKey(time time.Time, keyCode uint16)

func IncrTotalCount

func IncrTotalCount(time time.Time)

func InitConnection

func InitConnection(option redis.Options, verifyExit bool)

func InitDb

func InitDb()

InitDb 目前Leveldb仅用于web查询和处理逻辑

func MaxKPMVal

func MaxKPMVal(time time.Time) string

func TempKPMVal

func TempKPMVal(time time.Time) string

func TotalCountVal

func TotalCountVal(time time.Time) int

Types

type DetailVO

type DetailVO struct {
	Code    int
	HitTime int64
}

func QueryDetailByDay

func QueryDetailByDay(day string) []DetailVO

func QueryDetailByKey

func QueryDetailByKey(key string) []DetailVO

func (*DetailVO) ToString

func (d *DetailVO) ToString() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL