collector event

This commit is contained in:
insanity 2016-11-28 16:34:24 +09:00
parent 4a736053fa
commit cffed7b6f5

View File

@ -1,13 +1,60 @@
package events package events
//Collector Install Event
type CollectorInstallEvent struct { type CollectorInstallEvent struct {
Message string Version string
} }
func (i CollectorInstallEvent) GetUrl() string { func (e CollectorInstallEvent) GetUrl() string {
return COLLECTOR_INSTALL return COLLECTOR_INSTALL
} }
func NewInstallEvent(message string) *CollectorInstallEvent { func NewInstallEvent(ver string) *CollectorInstallEvent {
return &CollectorInstallEvent{Message: message} 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,
}
} }