mirror of
https://gitee.com/shikong-sk/gofiber-study
synced 2025-02-24 15:52:15 +08:00
13 lines
255 B
Go
13 lines
255 B
Go
|
package global
|
||
|
|
||
|
import (
|
||
|
gonanoid "github.com/matoous/go-nanoid"
|
||
|
"gofiber.study.skcks.cn/common/config"
|
||
|
)
|
||
|
|
||
|
var NanoIdConfig *config.NanoIdConfig
|
||
|
|
||
|
func GetNanoId() (string, error) {
|
||
|
return gonanoid.Generate(NanoIdConfig.Sequence, NanoIdConfig.Length)
|
||
|
}
|