mirror of
https://github.com/stefanprodan/podinfo.git
synced 2026-02-28 17:10:19 +00:00
When calling /echo, the backends requests will be run in parallel and the results are aggregated and returned to the caller as a json array
33 lines
708 B
Go
33 lines
708 B
Go
package api
|
|
|
|
import (
|
|
"time"
|
|
|
|
"github.com/gorilla/mux"
|
|
"go.uber.org/zap"
|
|
)
|
|
|
|
func NewMockServer() *Server {
|
|
config := &Config{
|
|
Port: "9898",
|
|
HttpServerShutdownTimeout: 5 * time.Second,
|
|
HttpServerTimeout: 30 * time.Second,
|
|
BackendURL: []string{},
|
|
ConfigPath: "/config",
|
|
DataPath: "/data",
|
|
HttpClientTimeout: 30 * time.Second,
|
|
UIColor: "blue",
|
|
UIPath: ".ui",
|
|
UIMessage: "Greetings",
|
|
Hostname: "localhost",
|
|
}
|
|
|
|
logger, _ := zap.NewDevelopment()
|
|
|
|
return &Server{
|
|
router: mux.NewRouter(),
|
|
logger: logger,
|
|
config: config,
|
|
}
|
|
}
|