Compare commits

..

2 Commits
v1.5.0 ... main

2 changed files with 23 additions and 6 deletions

View File

@ -1,5 +1,8 @@
# Changelog: @go/id
## v1.5.1 (2026-06-08)
- **JS 极简 API**: 彻底废除 JS 侧冗长难记的 `get8Bytes...` 等方法,统一收敛为极简的 `Make(size int, forDB ...string)`。充分利用了底层 JS Bridge 的零值回退特性,在不填第二个参数时也能安全优雅地工作。
## [v1.3.2] - 2026-05-30
### Added

View File

@ -1,13 +1,27 @@
package id
import "apigo.cc/go/jsmod"
import (
"strings"
"apigo.cc/go/jsmod"
)
func init() {
jsmod.Register("id", map[string]any{
"get8Bytes4KPerSecond": Get8Bytes4KPerSecond,
"get9Bytes90KPerSecond": Get9Bytes90KPerSecond,
"get10Bytes14MPerSecond": Get10Bytes14MPerSecond,
"get11Bytes900MPerSecond": Get11Bytes900MPerSecond,
"get12BytesUltraPerSecond": Get12BytesUltraPerSecond,
"Make": func(size int, forDB *string) string {
dbType := ""
if forDB != nil {
dbType = strings.ToLower(*forDB)
}
switch dbType {
case "mysql":
return DefaultIDMaker.GetForMysql(size)
case "postgres", "pg", "pgsql":
return DefaultIDMaker.GetForPostgreSQL(size)
default:
return DefaultIDMaker.Get(size)
}
},
})
}