2024-10-21 17:53:36 -05:00
|
|
|
package virtbuf
|
|
|
|
|
|
|
|
import "log"
|
|
|
|
|
|
|
|
//
|
|
|
|
// This generates some sample data. It *should* match the .proto file
|
|
|
|
//
|
|
|
|
|
|
|
|
func CreateSampleDroplet() *Droplet {
|
|
|
|
// TODO: flush this out to do all the fields
|
|
|
|
log.Println("CreateSampleDroplet() is generating a new droplet")
|
|
|
|
|
|
|
|
e := &Droplet{
|
|
|
|
Uuid: "6a1c571b-1d02-462b-9288-63d205306d76",
|
|
|
|
Hostname: "bmath.wit.com",
|
|
|
|
Comment: "this is a droplet for testing",
|
|
|
|
}
|
|
|
|
return e
|
|
|
|
}
|
|
|
|
|
|
|
|
func CreateSampleDroplets(total int) []Droplet {
|
|
|
|
|
|
|
|
var all []Droplet
|
|
|
|
|
|
|
|
for i := 0; i < total; i++ {
|
|
|
|
d := CreateSampleDroplet()
|
|
|
|
|
|
|
|
// e.Id += 1000 + int32(i)
|
2024-10-21 22:21:22 -05:00
|
|
|
d.Comment = "Sample Droplet " + string(i)
|
2024-10-21 17:53:36 -05:00
|
|
|
|
|
|
|
all = append(all, *d)
|
|
|
|
}
|
|
|
|
|
|
|
|
return all
|
|
|
|
}
|