1
0
mirror of https://github.com/divan/expvarmon.git synced 2025-05-04 22:18:08 +08:00
expvarmon/ui_dummy.go

36 lines
632 B
Go
Raw Normal View History

2015-04-21 12:51:01 +03:00
package main
import (
"fmt"
)
// DummyUI is an simple console UI mockup, for testing purposes.
type DummyUI struct{}
2015-05-01 19:13:23 +03:00
// Init implements UI.
2015-05-01 18:48:34 +03:00
func (*DummyUI) Init(UIData) error { return nil }
2015-05-01 19:13:23 +03:00
// Close implements UI.
func (*DummyUI) Close() {}
// Update implements UI.
2015-05-01 14:37:28 +03:00
func (*DummyUI) Update(data UIData) {
2015-04-21 12:51:01 +03:00
if data.Services == nil {
return
}
for _, service := range data.Services {
fmt.Printf("%s: ", service.Name)
if service.Err != nil {
fmt.Printf("ERROR: %s", service.Err)
continue
}
2015-04-25 15:54:17 +03:00
/*
if service.Goroutines != 0 {
fmt.Printf("goroutines: %d", service.Goroutines)
}
*/
2015-04-21 12:51:01 +03:00
fmt.Printf("\n")
}
}