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.
func MustNewForEntityString ¶
MustNewForEntityString is like NewForEntityString but panics on error
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.
func NewForEntityString ¶
NewForEntityString is a convenience wrapper that accepts string entity types
Types ¶
type EntityType ¶
type EntityType string
EntityType represents the different entity types in the system
const ( EntityTypeThreat EntityType = "threat" EntityTypeMetadata EntityType = "metadata" )
Click to show internal directories.
Click to hide internal directories.