| 299 | } |
| 300 | |
| 301 | func (s *Server) modeAPIHandler(mode ServerMode) (http.Handler, string) { |
| 302 | switch mode { |
| 303 | case LoginServerMode: |
| 304 | return http.HandlerFunc(s.serveLoginAPI), "web_login_client_initialization" |
| 305 | case ReadOnlyServerMode: |
| 306 | return http.HandlerFunc(s.serveLoginAPI), "web_readonly_client_initialization" |
| 307 | case ManageServerMode: |
| 308 | return http.HandlerFunc(s.serveAPI), "web_client_initialization" |
| 309 | default: // invalid mode |
| 310 | log.Fatalf("invalid mode: %v", mode) |
| 311 | } |
| 312 | return nil, "" |
| 313 | } |
| 314 | |
| 315 | func (s *Server) Shutdown() { |
| 316 | s.logf("web.Server: shutting down") |