feat: implement core backend architecture and project management services for the History API
Build and Release / release (push) Successful in 1m33s
Build and Release / release (push) Successful in 1m33s
This commit is contained in:
Vendored
+22
@@ -0,0 +1,22 @@
|
||||
package cache
|
||||
|
||||
import (
|
||||
"strconv"
|
||||
|
||||
"github.com/cespare/xxhash/v2"
|
||||
|
||||
"history-api/pkg/jsonx"
|
||||
)
|
||||
|
||||
func Key(prefix, id string) string {
|
||||
return prefix + ":" + id
|
||||
}
|
||||
|
||||
func Key2(prefix, first, second string) string {
|
||||
return prefix + ":" + first + ":" + second
|
||||
}
|
||||
|
||||
func QueryKey(prefix string, params any) string {
|
||||
data, _ := jsonx.Marshal(params)
|
||||
return prefix + ":" + strconv.FormatUint(xxhash.Sum64(data), 16)
|
||||
}
|
||||
Reference in New Issue
Block a user