Generalize event.

This commit is contained in:
François de Metz
2016-06-28 19:32:41 +02:00
parent 4176375480
commit 75be330318
4 changed files with 40 additions and 6 deletions

View File

@@ -2,20 +2,20 @@ package filestack
import "strconv"
type DialogEvent struct {
type FilestackEvent struct {
Action string `json:"action"`
TimeStamp int64 `json:"timestamp"`
Id int `json:"id"`
}
func (de *DialogEvent) Tags() map[string]string {
func (fe *FilestackEvent) Tags() map[string]string {
return map[string]string{
"action": de.Action,
"action": fe.Action,
}
}
func (de *DialogEvent) Fields() map[string]interface{} {
func (fe *FilestackEvent) Fields() map[string]interface{} {
return map[string]interface{}{
"id": strconv.Itoa(de.Id),
"id": strconv.Itoa(fe.Id),
}
}