MCPcopy Index your code
hub / github.com/tailscale/tailscale / modeAPIHandler

Method modeAPIHandler

client/web/web.go:301–313  ·  view source on GitHub ↗
(mode ServerMode)

Source from the content-addressed store, hash-verified

299}
300
301func (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
315func (s *Server) Shutdown() {
316 s.logf("web.Server: shutting down")

Callers 1

NewServerFunction · 0.80

Calls 1

FatalfMethod · 0.65

Tested by

no test coverage detected