Update go-pluggable

This commit is contained in:
Ettore Di Giacinto
2021-05-13 18:13:44 +02:00
parent 186ac33156
commit 45c8dfa19f
5 changed files with 39 additions and 7 deletions

View File

@@ -29,6 +29,7 @@ type EventType string
type Event struct {
Name EventType `json:"name"`
Data string `json:"data"`
File string `json:"file"` // If Data >> 10K write content to file instead
}
// EventResponse describes the event response structure
@@ -45,6 +46,12 @@ func (e Event) JSON() (string, error) {
return string(dat), err
}
// Copy returns a copy of Event
func (e Event) Copy() *Event {
copy := &e
return copy
}
func (e Event) ResponseEventName(s string) EventType {
return EventType(fmt.Sprintf("%s-%s", e.Name, s))
}