witProtobuf/sampleData.go

46 lines
838 B
Go
Raw Normal View History

package witProtobuf
import "log"
// import "bytes"
// import "os"
// import "bufio"
// import "io"
// import "io/ioutil"
func CreateSampleEvent() *Event {
// TODO: flush this out to do all the fields
log.Println("CreateSampleEvent() is generating a example protobuf Event")
e := &Event{
Id: 1234,
Name: "jcarrEvent1",
Email: "jcarr@wit.com",
Results: []*Event_Response{
{Name: "foobar", Type: Event_ADD},
},
}
e.Id += 1
e.Name = "jcarrEvent2"
return e
}
func CreateSampleEvents(total int) []Event {
// TODO: flush this out to do all the fields
log.Println("CreateSampleEvent() is generating %d protobuf Events", total)
var all []Event
for i := 0; i < total; i++ {
e := CreateSampleEvent()
e.Id += 1000 + int32(i)
e.Name = "jcarrEvent2"
all = append(all, *e)
}
return all
}