1
0
mirror of https://github.com/divan/expvarmon.git synced 2025-05-01 13:48:50 +08:00
expvarmon/ui_dummy.go
2015-05-01 18:48:34 +03:00

31 lines
569 B
Go

package main
import (
"fmt"
)
// DummyUI is an simple console UI mockup, for testing purposes.
type DummyUI struct{}
func (*DummyUI) Init(UIData) error { return nil }
func (*DummyUI) Close() {}
func (*DummyUI) Update(data UIData) {
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
}
/*
if service.Goroutines != 0 {
fmt.Printf("goroutines: %d", service.Goroutines)
}
*/
fmt.Printf("\n")
}
}