diff options
| author | Jeff Carr <[email protected]> | 2024-10-22 03:13:12 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2024-10-22 03:13:12 -0500 |
| commit | 9bc90046d9ded6bfc6e84e4ced9bf693ee6af6fb (patch) | |
| tree | 5917de5200447c15ba61520bbfe43742cc755700 /sampleData.go | |
| parent | aa70a02dd8f0c5fc36938fa119ce219bbdf10cc7 (diff) | |
need to redo this example code
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'sampleData.go')
| -rw-r--r-- | sampleData.go | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/sampleData.go b/sampleData.go index 7f64b96..d0932d4 100644 --- a/sampleData.go +++ b/sampleData.go @@ -3,18 +3,22 @@ package virtbuf import ( "fmt" "log" + + "github.com/google/uuid" ) // -// This generates some sample data. It *should* match the .proto file +// This generates some sample data. // func CreateSampleDroplet(hostname string) *Droplet { // TODO: flush this out to do all the fields log.Println("CreateSampleDroplet() is generating a new droplet", hostname) + // Generate a new UUID + id := uuid.New() d := &Droplet{ - Uuid: "6a1c571b-1d02-462b-9288-63d205306d76", + Uuid: id.String(), Hostname: hostname, Comment: "this is a droplet for testing", } @@ -28,8 +32,6 @@ func CreateSampleCluster(total int) *Cluster { for i := 0; i < total; i++ { hostname := fmt.Sprintf("bmath%d.wit.com", i) d := CreateSampleDroplet(hostname) - - // e.Id += 1000 + int32(i) d.Comment = fmt.Sprintf("Sample Droplet %d", i) c.Droplets = append(c.Droplets, d) |
