Search Options

Results per page
Sort
Preferred Languages
Advance

Results 21 - 30 of 48 for HandleFunc (0.22 sec)

  1. src/net/http/servemux121.go

    	es = append(es, muxEntry{}) // try to grow the slice in place, any entry works.
    	copy(es[i+1:], es[i:])      // Move shorter entries down
    	es[i] = e
    	return es
    }
    
    // Formerly ServeMux.HandleFunc.
    func (mux *serveMux121) handleFunc(pattern string, handler func(ResponseWriter, *Request)) {
    	if handler == nil {
    		panic("http: nil handler")
    	}
    	mux.handle(pattern, HandlerFunc(handler))
    }
    
    // Formerly ServeMux.Handler.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Apr 18 15:40:38 UTC 2024
    - 5.8K bytes
    - Viewed (0)
  2. pkg/bootstrap/platform/aws_test.go

    }
    
    func setupHTTPServer(handlers map[string]handlerFunc) (*httptest.Server, *url.URL) {
    	handler := http.NewServeMux()
    	for path, handle := range handlers {
    		handler.HandleFunc(path, handle)
    	}
    	server := httptest.NewServer(handler)
    	url, _ := url.Parse(server.URL)
    	return server, url
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Fri Mar 18 13:10:06 UTC 2022
    - 3.2K bytes
    - Viewed (0)
  3. staging/src/k8s.io/apiserver/pkg/server/mux/pathrecorder.go

    	m.exposedPaths = append(m.exposedPaths, path)
    	m.pathToHandler[path] = handler
    	m.refreshMuxLocked()
    }
    
    // HandleFunc registers the handler function for the given pattern.
    // If a handler already exists for pattern, Handle panics.
    func (m *PathRecorderMux) HandleFunc(path string, handler func(http.ResponseWriter, *http.Request)) {
    	m.Handle(path, http.HandlerFunc(handler))
    }
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Apr 12 01:52:15 UTC 2024
    - 8.5K bytes
    - Viewed (0)
  4. pkg/dns/client/dns_test.go

    	mux := dns.NewServeMux()
    	mux.HandleFunc(".", func(resp dns.ResponseWriter, msg *dns.Msg) {
    		answer := new(dns.Msg)
    		answer.SetReply(msg)
    		answer.Rcode = dns.RcodeNameError
    		if err := resp.WriteMsg(answer); err != nil {
    			t.Fatalf("err: %s", err)
    		}
    	})
    	for hn, desiredResp := range responses {
    		mux.HandleFunc(hn, func(resp dns.ResponseWriter, msg *dns.Msg) {
    			answer := dns.Msg{
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Thu Feb 29 16:17:34 UTC 2024
    - 20.4K bytes
    - Viewed (0)
  5. pilot/pkg/bootstrap/webhook.go

    		ErrorLog:  log.New(&httpServerErrorLogWriter{}, "", 0),
    		Handler:   s.httpsMux,
    		TLSConfig: tlsConfig,
    	}
    
    	// register istiodReadyHandler on the httpsMux so that readiness can also be checked remotely
    	s.httpsMux.HandleFunc("/ready", s.istiodReadyHandler)
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Tue Jun 11 17:37:53 UTC 2024
    - 2.7K bytes
    - Viewed (0)
  6. pkg/log/uds_test.go

    	}
    	loggingOptions := DefaultOptions()
    	loggingOptions.JSONEncoding = true
    	if err := Configure(loggingOptions.WithTeeToUDS(socketPath, "/")); err != nil {
    		t.Fatal(err)
    	}
    	mux := http.NewServeMux()
    	mux.HandleFunc("/", srv.handleLog)
    
    	go func() {
    		if err := http.Serve(unixListener, mux); err != nil {
    			t.Error(err)
    		}
    	}()
    
    	{
    		t.Log("test sending normal log")
    
    		WithLabels("k", "v").Info("test")
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Wed Nov 29 01:05:12 UTC 2023
    - 3.2K bytes
    - Viewed (0)
  7. pilot/pkg/model/test/mockopenidserver.go

    }
    
    // Start starts the mock server.
    func (ms *MockOpenIDDiscoveryServer) Start() error {
    	var handler http.Handler
    	router := mux.NewRouter()
    	router.HandleFunc("/.well-known/openid-configuration", ms.openIDCfg).Methods("GET")
    	router.HandleFunc("/oauth2/v3/certs", ms.jwtPubKey).Methods("GET")
    	handler = router
    	if ms.timeout != 0 {
    		handler = withDelay(router, ms.timeout)
    	}
    	server := &http.Server{
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Fri Feb 23 09:47:21 UTC 2024
    - 9.4K bytes
    - Viewed (0)
  8. docs/iam/access-manager-plugin.go

    			log.Fatal("Please provide both a key file and a cert file to enable TLS.")
    		}
    		serveFunc = func() error {
    			return http.ListenAndServeTLS(":8080", certFile, keyFile, nil)
    		}
    	}
    
    	http.HandleFunc("/", mainHandler)
    
    	log.Print("Listening on :8080")
    	log.Fatal(serveFunc())
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Thu Feb 08 17:15:20 UTC 2024
    - 2.7K bytes
    - Viewed (0)
  9. src/expvar/expvar.go

    func memstats() any {
    	stats := new(runtime.MemStats)
    	runtime.ReadMemStats(stats)
    	return *stats
    }
    
    func init() {
    	if godebug.New("httpmuxgo121").Value() == "1" {
    		http.HandleFunc("/debug/vars", expvarHandler)
    	} else {
    		http.HandleFunc("GET /debug/vars", expvarHandler)
    	}
    	Publish("cmdline", Func(cmdline))
    	Publish("memstats", Func(memstats))
    }
    
    // TODO: Use json.appendString instead.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Apr 26 21:32:11 UTC 2024
    - 9.1K bytes
    - Viewed (0)
  10. pkg/webhooks/validation/server/server.go

    		return nil, errors.New("expected mux to be passed, but was not passed")
    	}
    	wh := &Webhook{
    		schemas:      o.Schemas,
    		domainSuffix: o.DomainSuffix,
    	}
    
    	o.Mux.HandleFunc("/validate", wh.serveValidate)
    	o.Mux.HandleFunc("/validate/", wh.serveValidate)
    
    	return wh, nil
    }
    
    func toAdmissionResponse(err error) *kube.AdmissionResponse {
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Sat May 04 06:13:56 UTC 2024
    - 9.3K bytes
    - Viewed (0)
Back to top