diff options
Diffstat (limited to 'sampleData.go')
| -rw-r--r-- | sampleData.go | 20 |
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) } |
