Print monitor features

This commit is contained in:
Matej Kramny
2017-02-04 22:15:24 -08:00
parent a2d8128109
commit edfd4a51e6
4 changed files with 43 additions and 43 deletions

View File

@@ -15,7 +15,8 @@ const HistorySize = 10
type MonitorInterface interface {
do() bool
Validate() []string
GetMonitor() AbstractMonitor
GetMonitor() *AbstractMonitor
Describe() []string
}
// AbstractMonitor data model
@@ -59,9 +60,18 @@ func (mon *AbstractMonitor) do() bool {
func (mon *AbstractMonitor) Validate() []string {
return []string{}
}
func (mon AbstractMonitor) GetMonitor() AbstractMonitor {
func (mon *AbstractMonitor) GetMonitor() *AbstractMonitor {
return mon
}
func (mon AbstractMonitor) Describe() []string {
features := []string{"Type: " + mon.Type}
if len(mon.Name) > 0 {
features = append(features, "Name: "+mon.Name)
}
return features
}
func (mon *AbstractMonitor) Start(cfg *CachetMonitor, wg *sync.WaitGroup) {
wg.Add(1)