github.com/prebid/prebid-server/v2@v2.18.0/util/uuidutil/uuidutil.go (about) 1 package uuidutil 2 3 import ( 4 "github.com/gofrs/uuid" 5 ) 6 7 type UUIDGenerator interface { 8 Generate() (string, error) 9 } 10 11 type UUIDRandomGenerator struct{} 12 13 func (UUIDRandomGenerator) Generate() (string, error) { 14 id, err := uuid.NewV4() 15 if err != nil { 16 return "", err 17 } 18 return id.String(), nil 19 }