func NewServer()

in pkg/server/server.go [56:80]


func NewServer(lchecks *Checks, rchecks *Checks) *Server {

	s := &Server{
		Config: common.GetConfig(),
	}

	mux := http.NewServeMux()
	// Register probers (liveness and Readiness)
	// The default liveness probe is tickSerivce unless specified
	if lchecks != nil {
		mux.Handle("/liveness", lchecks.Healthz())
	} else {
		mux.Handle("/liveness", s.Healthz())
	}

	s.httpserver = &http.Server{
		Addr:         ":8080",
		Handler:      mux,
		ReadTimeout:  5 * time.Second,
		WriteTimeout: 10 * time.Second,
		IdleTimeout:  15 * time.Second,
	}

	return s
}