示例#1
0
func serversOverview(servers []engine.Server) string {
	t := goterm.NewTable(0, 10, 5, ' ', 0)
	fmt.Fprint(t, "Id\tURL\tReqs/sec\t50ile[ms]\t95ile[ms]\t99ile[ms]\tStatus codes %%\tNet. errors %%\tMessages\n")

	for _, e := range servers {
		serverOverview(t, e)
	}
	return t.String()
}
示例#2
0
文件: view.go 项目: davemkirk/vulcand
func serversView(srvs []engine.Server) string {
	t := goterm.NewTable(0, 10, 5, ' ', 0)
	fmt.Fprint(t, "Id\tURL\n")
	if len(srvs) == 0 {
		return t.String()
	}
	for _, v := range srvs {
		fmt.Fprint(t, serverView(&v))
	}
	return t.String()
}
示例#3
0
文件: view.go 项目: davemkirk/vulcand
func backendsView(bs []engine.Backend) string {
	t := goterm.NewTable(0, 10, 5, ' ', 0)
	fmt.Fprint(t, "Id\tType\n")

	if len(bs) == 0 {
		return t.String()
	}
	for _, v := range bs {
		fmt.Fprint(t, backendView(&v))
	}
	return t.String()
}
示例#4
0
文件: view.go 项目: davemkirk/vulcand
func frontendsView(fs []engine.Frontend) string {
	t := goterm.NewTable(0, 10, 5, ' ', 0)
	fmt.Fprint(t, "Id\tRoute\tBackend\tType\n")

	if len(fs) == 0 {
		return t.String()
	}
	for _, v := range fs {
		fmt.Fprint(t, frontendView(&v))
	}
	return t.String()
}
示例#5
0
文件: view.go 项目: davemkirk/vulcand
func listenersView(ls []engine.Listener) string {
	t := goterm.NewTable(0, 10, 5, ' ', 0)
	fmt.Fprint(t, "Id\tProtocol\tNetwork\tAddress\tScope\n")

	if len(ls) == 0 {
		return t.String()
	}
	for _, l := range ls {
		fmt.Fprint(t, listenerView(&l))
	}
	return t.String()
}
示例#6
0
文件: view.go 项目: davemkirk/vulcand
func hostsView(hs []engine.Host) string {
	t := goterm.NewTable(0, 10, 5, ' ', 0)
	fmt.Fprint(t, "Name\tDefault\n")

	if len(hs) == 0 {
		return t.String()
	}
	for _, h := range hs {
		fmt.Fprint(t, hostView(&h))
	}
	return t.String()
}
示例#7
0
func frontendsOverview(frontends []engine.Frontend) string {
	t := goterm.NewTable(0, 10, 5, ' ', 0)
	fmt.Fprint(t, "Id\tRoute\tR/sec\t50ile[ms]\t95ile[ms]\t99ile[ms]\tStatus codes %%\tNet. errors %%\n")

	if len(frontends) == 0 {
		return t.String()
	}
	for _, l := range frontends {
		frontendOverview(t, l)
	}
	return t.String()
}
示例#8
0
文件: view.go 项目: davemkirk/vulcand
func middlewaresView(ms []engine.Middleware) string {
	sort.Sort(&middlewareSorter{ms: ms})

	t := goterm.NewTable(0, 10, 5, ' ', 0)
	fmt.Fprint(t, "Id\tPriority\tType\tSettings\n")
	if len(ms) == 0 {
		return t.String()
	}
	for _, v := range ms {
		fmt.Fprint(t, middlewareView(&v))
	}
	return t.String()
}