1
0
mirror of https://github.com/divan/expvarmon.git synced 2025-04-27 13:48:55 +08:00
expvarmon/ui_dummy.go
2015-04-30 23:54:54 +03:00

31 lines
539 B
Go

package main
import (
"fmt"
)
// DummyUI is an simple console UI mockup, for testing purposes.
type DummyUI struct{}
func (*DummyUI) Init(Data) {}
func (*DummyUI) Close() {}
func (*DummyUI) Update(data Data) {
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")
}
}