blob: 7f64b964a236ad2270e83840d39baf814742b70f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
package virtbuf
import (
"fmt"
"log"
)
//
// This generates some sample data. It *should* match the .proto file
//
func CreateSampleDroplet(hostname string) *Droplet {
// TODO: flush this out to do all the fields
log.Println("CreateSampleDroplet() is generating a new droplet", hostname)
d := &Droplet{
Uuid: "6a1c571b-1d02-462b-9288-63d205306d76",
Hostname: hostname,
Comment: "this is a droplet for testing",
}
return d
}
func CreateSampleCluster(total int) *Cluster {
var c *Cluster
c = new(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)
}
return c
}
|