func NewEvent(eventType EventType, description string, err error, contactInfo []string, endpoints []IEndPoint) *Event {
	seed := time.Now()
	event := &Event{
		ID:          rand.UUID(true),
		Type:        eventType,
		Name:        eventsTextMap[eventType],
		Error:       err,
		ContactInfo: contactInfo,
		Endpoints:   endpoints,
	}
	event.data = map[string]interface{}{
		"ID":          event.ID,
		"Event":       event.Name,
		"Description": description,
		"Timestamp":   seed.UnixNano(),
		"Datetime":    seed,
	}
	if err != nil {
		event.data["Exception"] = err.Error()
	}
	return event
}
NewEvent is exported
package notify
import "github.com/cloudtask/libtools/gounits/rand"
import (
	"bytes"
	"html/template"
	"time"
)
type EventType int
const (
	LocationServersEvent EventType = 1000
	JobNotifyEvent EventType = 1001
)
var eventsTextMap = map[EventType]string{
	LocationServersEvent: "LocationServersEvent",
	JobNotifyEvent:       "JobNotifyEvent",
}
type Event struct {
	ID          string
	Type        EventType
	Name        string
	Error       error
	ContactInfo []string
	Endpoints   []IEndPoint
	data        map[string]interface{}
}