2017-12-15 04:33:38 +00:00
|
|
|
package id
|
2016-10-10 22:00:27 +00:00
|
|
|
|
2017-12-15 04:33:38 +00:00
|
|
|
import (
|
|
|
|
"github.com/influxdata/chronograf"
|
|
|
|
uuid "github.com/satori/go.uuid"
|
|
|
|
)
|
2016-10-16 01:34:57 +00:00
|
|
|
|
2017-12-15 04:43:15 +00:00
|
|
|
var _ chronograf.ID = &UUID{}
|
2017-12-15 04:33:38 +00:00
|
|
|
|
|
|
|
// UUID generates a V4 uuid
|
|
|
|
type UUID struct{}
|
2016-10-10 22:00:27 +00:00
|
|
|
|
2016-10-16 01:34:57 +00:00
|
|
|
// Generate creates a UUID v4 string
|
2017-12-15 04:33:38 +00:00
|
|
|
func (i *UUID) Generate() (string, error) {
|
2016-10-11 00:34:05 +00:00
|
|
|
return uuid.NewV4().String(), nil
|
2016-10-10 22:00:27 +00:00
|
|
|
}
|