From cffed7b6f5b7682f53fda18a5b1094b61187bd4e Mon Sep 17 00:00:00 2001 From: insanity Date: Mon, 28 Nov 2016 16:34:24 +0900 Subject: [PATCH] collector event --- events/event_collector.go | 55 ++++++++++++++++++++++++++++++++++++--- 1 file changed, 51 insertions(+), 4 deletions(-) diff --git a/events/event_collector.go b/events/event_collector.go index 36df1ae..02d8a58 100644 --- a/events/event_collector.go +++ b/events/event_collector.go @@ -1,13 +1,60 @@ package events +//Collector Install Event type CollectorInstallEvent struct { - Message string + Version string } -func (i CollectorInstallEvent) GetUrl() string { +func (e CollectorInstallEvent) GetUrl() string { return COLLECTOR_INSTALL } -func NewInstallEvent(message string) *CollectorInstallEvent { - return &CollectorInstallEvent{Message: message} +func NewInstallEvent(ver string) *CollectorInstallEvent { + return &CollectorInstallEvent{ + Version: ver, + } +} + +//Collector Initialize Event : to do +type CollectorInitEvent struct { + OS string + Conf string +} + +func (e CollectorInitEvent) GetUrl() string { + return COLLECTOR_INIT +} + +func NewCollectorInitEvent(os, conf string) *CollectorInitEvent { + return &CollectorInitEvent{ + OS: os, + Conf: conf, + } +} + +//Collector Start Event +type CollectorStartEvent struct { +} + +func (e CollectorStartEvent) GetUrl() string { + return COLLECTOR_START +} + +func NewCollectorStartEvent(message string) *CollectorStartEvent { + return &CollectorStartEvent{} +} + +//Collector Stop Event +type CollectorStopEvent struct { + Reason string +} + +func (e CollectorStopEvent) GetUrl() string { + return COLLECTOR_STOP +} + +func NewCollectorStopEvent(reason string) *CollectorStopEvent { + return &CollectorStopEvent{ + Reason: reason, + } }