Documentation
¶
Index ¶
- func MustNewForEntity(entityType EntityType) uuid.UUID
- func MustNewForEntityString(entityType string) uuid.UUID
- func MustNewV4() uuid.UUID
- func MustNewV7() uuid.UUID
- func NewForEntity(entityType EntityType) (uuid.UUID, error)
- func NewForEntityString(entityType string) (uuid.UUID, error)
- func NewV4() (uuid.UUID, error)
- func NewV7() (uuid.UUID, error)
- type EntityType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MustNewForEntity ¶
func MustNewForEntity(entityType EntityType) uuid.UUID
MustNewForEntity is like NewForEntity but panics on error. Should only be used in situations where UUID generation failure is unrecoverable. SEM@54ce780187c82c328300f63352fb57ca67a12d0c: generate a UUID for an entity type, panicking on failure (pure)
func MustNewForEntityString ¶
MustNewForEntityString is like NewForEntityString but panics on error SEM@54ce780187c82c328300f63352fb57ca67a12d0c: generate a UUID for a string-typed entity name, panicking on failure (pure)
func MustNewV4 ¶
MustNewV4 is like NewV4 but panics on error SEM@54ce780187c82c328300f63352fb57ca67a12d0c: generate a random UUIDv4, panicking on failure (pure)
func MustNewV7 ¶
MustNewV7 is like NewV7 but panics on error SEM@54ce780187c82c328300f63352fb57ca67a12d0c: generate a time-ordered UUIDv7, panicking on failure (pure)
func NewForEntity ¶
func NewForEntity(entityType EntityType) (uuid.UUID, error)
NewForEntity generates a UUID appropriate for the given entity type. High-volume entities (threats, metadata) use UUIDv7 for better index locality. All other entities use UUIDv4 for compatibility and distribution. SEM@54ce780187c82c328300f63352fb57ca67a12d0c: generate a UUID selecting v7 for high-volume entities and v4 for all others (pure)
func NewForEntityString ¶
NewForEntityString is a convenience wrapper that accepts string entity types SEM@54ce780187c82c328300f63352fb57ca67a12d0c: generate a UUID for a string-typed entity name, delegating to NewForEntity (pure)
Types ¶
type EntityType ¶
type EntityType string
EntityType represents the different entity types in the system SEM@54ce780187c82c328300f63352fb57ca67a12d0c: string type discriminating entity categories for UUID version selection (pure)
const ( EntityTypeThreat EntityType = "threat" EntityTypeMetadata EntityType = "metadata" )