feat: 添加 database - cache(redis)

This commit is contained in:
zhaoyupeng
2025-06-18 18:44:45 +08:00
parent 7dd48c0c50
commit edce9fe73f
8 changed files with 475 additions and 9 deletions

11
tool/string.go Normal file
View File

@ -0,0 +1,11 @@
package tool
import "unsafe"
func BytesToString(b []byte) string {
return unsafe.String(unsafe.SliceData(b), len(b))
}
func StringToBytes(s string) []byte {
return unsafe.Slice(unsafe.StringData(s), len(s))
}