Start move to unify ID generation
All checks were successful
/ docker (push) Successful in 4m14s

This commit is contained in:
Melody Becker 2025-04-28 17:28:28 +02:00
parent aa2b056f8b
commit d32818af09
Signed by: mstar
SSH key fingerprint: SHA256:9VAo09aaVNTWKzPW7Hq2LW+ox9OdwmTSHRoD4mlz1yI
8 changed files with 51 additions and 8 deletions

17
shared/ids.go Normal file
View file

@ -0,0 +1,17 @@
package shared
import (
"github.com/google/uuid"
"github.com/nrednav/cuid2"
"git.mstar.dev/mstar/linstrom/config"
)
// Generate a new string ID
func NewId() string {
if config.GlobalConfig.Experimental.UseCuid2Ids {
return cuid2.Generate()
} else {
return uuid.NewString()
}
}