Ejemplo n.º 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()
}
Ejemplo n.º 2
0
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()
}
Ejemplo n.º 3
0
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()
}
Ejemplo n.º 4
0
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()
}
Ejemplo n.º 5
0
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()
}
Ejemplo n.º 6
0
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()
}
Ejemplo n.º 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()
}
Ejemplo n.º 8
0
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()
}