Skip to content

Commit

Permalink
fix event type json tag
Browse files Browse the repository at this point in the history
  • Loading branch information
v9n committed Dec 11, 2019
1 parent 80a7620 commit b11c43e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
14 changes: 7 additions & 7 deletions extras/gaia/event.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,22 +30,22 @@ const (
)

type EventCheckInsert struct {
EventType EventType
EventType EventType `json:"event_type"`
*dao.Check
}

type EventCheckReplace struct {
EventType EventType
EventType EventType `json:"event_type"`
*dao.Check
}

type EventCheckDelete struct {
EventType EventType
EventType EventType `json:"event_type"`
*dao.Check
}

type EventCheckHTTPResult struct {
EventType EventType
EventType EventType `json:"event_type"`
ID string
IP string
Region string
Expand Down Expand Up @@ -121,7 +121,7 @@ func (e *EventCheckTCPResult) CheckType() string {
}

type EventCheckBeat struct {
EventType EventType
EventType EventType `json:"event_type"`
ID string
Action string
BeatAt time.Time
Expand Down Expand Up @@ -156,12 +156,12 @@ func (e *EventCheckBeat) MetricPayload() (map[string]interface{}, error) {
}

type EventRunCheck struct {
EventType EventType
EventType EventType `json:"event_type"`
ID string
}

type EventPing struct {
EventType EventType
EventType EventType `json:"event_type"`
At time.Time
}

Expand Down
4 changes: 2 additions & 2 deletions extras/gaia/eventbus.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ import (
)

type EventWrapper struct {
EventType EventType
EventType EventType `json:"event_type"`
}

type GenericEvent struct {
EventType EventType
EventType EventType `json:"event_type"`
*EventCheckInsert
*EventCheckReplace
*EventCheckDelete
Expand Down
1 change: 0 additions & 1 deletion extras/gaia/sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,6 @@ func (s *Syncer) ListenFromAgent(name string, sink *Sink) error {
}
agent.Stats.LastReceivedFromClient = time.Now()

log.Printf("Receive raw event %v from agent %s\n", string(message), name)
var evt GenericEvent
if err = evt.UnmarshalJSON(message); err != nil {
log.Println("Cannot unmarshalJSON")
Expand Down

0 comments on commit b11c43e

Please sign in to comment.