Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 5 of 5 for MainHandler (0.41 sec)

  1. docs/auditlog/auditlog-echo.go

    import (
    	"bytes"
    	"encoding/json"
    	"flag"
    	"fmt"
    	"io"
    	"log"
    	"net/http"
    )
    
    var port int
    
    func init() {
    	flag.IntVar(&port, "port", 8080, "Port to listen on")
    }
    
    func mainHandler(w http.ResponseWriter, r *http.Request) {
    	body, err := io.ReadAll(r.Body)
    	defer r.Body.Close()
    	if err != nil {
    		log.Printf("Error reading request body: %v", err)
    		w.WriteHeader(http.StatusBadRequest)
    		return
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Wed May 01 21:31:13 UTC 2024
    - 1.5K bytes
    - Viewed (0)
  2. docs/iam/identity-manager-plugin.go

    		},
    	},
    	"bbb": {
    		User:               "Bart",
    		MaxValiditySeconds: 3600,
    		Claims: map[string]interface{}{
    			"groups": []string{"databases"},
    		},
    	},
    }
    
    func mainHandler(w http.ResponseWriter, r *http.Request) {
    	token := r.FormValue("token")
    	if token == "" {
    		writeErrorResponse(w, errors.New("token parameter not given"))
    		return
    	}
    
    	rsp, ok := tokens[token]
    	if !ok {
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Wed May 01 21:31:13 UTC 2024
    - 2.1K bytes
    - Viewed (0)
  3. docs/iam/access-manager-plugin.go

    	w.WriteHeader(http.StatusBadRequest)
    	json.NewEncoder(w).Encode(map[string]string{
    		"error": fmt.Sprintf("%v", err),
    	})
    }
    
    type Result struct {
    	Result bool `json:"result"`
    }
    
    func mainHandler(w http.ResponseWriter, r *http.Request) {
    	body, err := io.ReadAll(r.Body)
    	if err != nil {
    		writeErrorResponse(w, err)
    		return
    	}
    
    	var out bytes.Buffer
    	json.Indent(&out, body, "", "  ")
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Thu Feb 08 17:15:20 UTC 2024
    - 2.7K bytes
    - Viewed (0)
  4. src/cmd/trace/main.go

    		return trace.MutatorUtilizationV2(parsed.events, flags), nil
    	}
    
    	mux := http.NewServeMux()
    
    	// Main endpoint.
    	mux.Handle("/", traceviewer.MainHandler([]traceviewer.View{
    		{Type: traceviewer.ViewProc, Ranges: ranges},
    		// N.B. Use the same ranges for threads. It takes a long time to compute
    		// the split a second time, but the makeup of the events are similar enough
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 17 18:48:18 UTC 2024
    - 10.4K bytes
    - Viewed (0)
  5. src/internal/trace/traceviewer/http.go

    // Use of this source code is governed by a BSD-style
    // license that can be found in the LICENSE file.
    
    package traceviewer
    
    import (
    	"embed"
    	"fmt"
    	"html/template"
    	"net/http"
    	"strings"
    )
    
    func MainHandler(views []View) http.Handler {
    	return http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) {
    		if err := templMain.Execute(w, views); err != nil {
    			http.Error(w, err.Error(), http.StatusInternalServerError)
    			return
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Nov 21 21:29:53 UTC 2023
    - 12.6K bytes
    - Viewed (0)
Back to top