initial pase store definitions

This commit is contained in:
juancwu 2026-05-04 18:39:25 +00:00
commit b947535795
10 changed files with 723 additions and 0 deletions

21
store/ulid.go Normal file
View file

@ -0,0 +1,21 @@
package store
import "github.com/oklog/ulid/v2"
// IDGenerator produces unique identifiers for entities.
type IDGenerator interface {
// NewID generates a new unique identifier for entities.
NewID() string
}
// defaultIDGenerator generates ULIDs using crypto/rand entropy.
type defaultIDGenerator struct{}
func (defaultIDGenerator) NewID() string {
return ulid.Make().String()
}
// DefaultIDGenerator returns the standard ULID-based generator.
func DefaultIDGenerator() IDGenerator {
return defaultIDGenerator{}
}