summaryrefslogtreecommitdiff
path: root/sampleData.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-10-22 03:04:59 -0500
committerJeff Carr <[email protected]>2024-10-22 03:04:59 -0500
commitaa70a02dd8f0c5fc36938fa119ce219bbdf10cc7 (patch)
tree12be617f5fdf01be02b761a54729b71d7f33d321 /sampleData.go
parentbcc97a550a70305f9182b452ef650789c2fa2b45 (diff)
change sample hostname
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'sampleData.go')
-rw-r--r--sampleData.go20
1 files changed, 12 insertions, 8 deletions
diff --git a/sampleData.go b/sampleData.go
index c910200..7f64b96 100644
--- a/sampleData.go
+++ b/sampleData.go
@@ -1,21 +1,24 @@
package virtbuf
-import "log"
+import (
+ "fmt"
+ "log"
+)
//
// This generates some sample data. It *should* match the .proto file
//
-func CreateSampleDroplet() *Droplet {
+func CreateSampleDroplet(hostname string) *Droplet {
// TODO: flush this out to do all the fields
- log.Println("CreateSampleDroplet() is generating a new droplet")
+ log.Println("CreateSampleDroplet() is generating a new droplet", hostname)
- e := &Droplet{
+ d := &Droplet{
Uuid: "6a1c571b-1d02-462b-9288-63d205306d76",
- Hostname: "bmath.wit.com",
+ Hostname: hostname,
Comment: "this is a droplet for testing",
}
- return e
+ return d
}
func CreateSampleCluster(total int) *Cluster {
@@ -23,10 +26,11 @@ func CreateSampleCluster(total int) *Cluster {
c = new(Cluster)
for i := 0; i < total; i++ {
- d := CreateSampleDroplet()
+ hostname := fmt.Sprintf("bmath%d.wit.com", i)
+ d := CreateSampleDroplet(hostname)
// e.Id += 1000 + int32(i)
- d.Comment = "Sample Droplet " + string(i)
+ d.Comment = fmt.Sprintf("Sample Droplet %d", i)
c.Droplets = append(c.Droplets, d)
}