summaryrefslogtreecommitdiff
path: root/sampleData.go
blob: d0932d48efac754cdf510b5759f7922380a7fec2 (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
40
41
package virtbuf

import (
	"fmt"
	"log"

	"github.com/google/uuid"
)

//
// 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:     id.String(),
		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)
		d.Comment = fmt.Sprintf("Sample Droplet %d", i)

		c.Droplets = append(c.Droplets, d)
	}

	return c
}