You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

18 lines
374 B

package models
type Event struct {
Name string `json:"name"`
Payload map[string]string `json:"payload,omitempty"`
}
func (e *Event) AddPayload(key, value string) {
if e.Payload == nil {
e.Payload = make(map[string]string, 8)
}
e.Payload[key] = value
}
func (e *Event) HasPayload(key string) bool {
return e.Payload != nil && e.Payload[key] != ""
}